mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 10:04:32 +03:00
Add '?' sign as a possible mark of wildcard.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
parent
ec0dd74248
commit
4d2cefa81e
@ -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;
|
||||
|
@ -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* */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user