Add '?' sign as a possible mark of wildcard.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Slava Zanko 2015-02-25 12:56:34 +03:00
parent ec0dd74248
commit 4d2cefa81e
2 changed files with 12 additions and 4 deletions

View File

@ -612,7 +612,7 @@ overwrite_query_dialog (file_op_context_t * ctx, enum OperationMode mode)
static gboolean
is_wildcarded (const char *p)
{
int escaped = 0;
gboolean escaped = FALSE;
for (; *p; p++)
{
if (*p == '\\')
@ -623,9 +623,9 @@ is_wildcarded (const char *p)
}
else
{
if (*p == '*' && !escaped)
if ((*p == '*' || *p == '?') && !escaped)
return TRUE;
escaped = 0;
escaped = FALSE;
}
}
return FALSE;

View File

@ -71,7 +71,7 @@ static const struct test_is_wildcarded_ds
},
{ /* 1 */
"bla?bla",
FALSE
TRUE
},
{ /* 2 */
"bla*bla",
@ -110,6 +110,14 @@ static const struct test_is_wildcarded_ds
"blabla\\",
FALSE
},
{ /* 11 */
"blab\\?la",
FALSE
},
{ /* 12 */
"blab\\\\?la",
TRUE
},
};
/* *INDENT-ON* */