Ticket #2123: crash while copying into directory named "????"
1. create directory named "????" and enter into this directory 2. point at any file in other panel 3. press F5 and Enter Segfault Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Этот коммит содержится в:
родитель
3108909bb0
Коммит
973bbb70a2
@ -118,14 +118,25 @@ mc_search__translate_replace_glob_to_regex (gchar *str)
|
||||
{
|
||||
GString *buff = g_string_new ("");
|
||||
int cnt = '0';
|
||||
|
||||
gboolean escaped_mode = FALSE;
|
||||
while (*str) {
|
||||
char c = *str++;
|
||||
switch (c) {
|
||||
case '\\':
|
||||
if (!escaped_mode)
|
||||
{
|
||||
escaped_mode = TRUE;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case '*':
|
||||
case '?':
|
||||
if (!escaped_mode)
|
||||
{
|
||||
g_string_append_c (buff, '\\');
|
||||
c = ++cnt;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
/* breaks copying: mc uses "\0" internally, it must not be changed */
|
||||
/*case '\\':*/
|
||||
@ -134,6 +145,7 @@ mc_search__translate_replace_glob_to_regex (gchar *str)
|
||||
break;
|
||||
}
|
||||
g_string_append_c (buff, c);
|
||||
escaped_mode = FALSE;
|
||||
}
|
||||
return buff;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@
|
||||
|
||||
static const char ESCAPE_SHELL_CHARS[] = " !#$%()&{}[]`?|<>;*\\\"'";
|
||||
static const char ESCAPE_REGEX_CHARS[] = "^!#$%()&{}[]`?|<>;*.\\";
|
||||
static const char ESCAPE_GLOB_CHARS[] = "$*\\";
|
||||
static const char ESCAPE_GLOB_CHARS[] = "$*\\?";
|
||||
|
||||
/*** file scope functions ************************************************************************/
|
||||
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user