b2df7e7
diff -up mc-4.7.3/lib/search/glob.c.dirname mc-4.7.3/lib/search/glob.c
b2df7e7
--- mc-4.7.3/lib/search/glob.c.dirname	2010-07-05 20:32:41.000000000 +0200
b2df7e7
+++ mc-4.7.3/lib/search/glob.c	2010-09-02 17:21:07.174555656 +0200
b2df7e7
@@ -118,14 +118,25 @@ mc_search__translate_replace_glob_to_reg
b2df7e7
 {
b2df7e7
     GString *buff = g_string_new ("");
b2df7e7
     int cnt = '0';
b2df7e7
-
b2df7e7
+    gboolean escaped_mode = FALSE;
b2df7e7
     while (*str) {
b2df7e7
 	char c = *str++;
b2df7e7
 	switch (c) {
b2df7e7
+	case '\\':
b2df7e7
+	    if (!escaped_mode)
b2df7e7
+	    {
b2df7e7
+	        escaped_mode = TRUE;
b2df7e7
+	    }
b2df7e7
+	    g_string_append_c (buff, c);
b2df7e7
+	    continue;
b2df7e7
 	case '*':
b2df7e7
 	case '?':
b2df7e7
+	    if (!escaped_mode)
b2df7e7
+	    {
b2df7e7
 	    g_string_append_c (buff, '\\');
b2df7e7
 	    c = ++cnt;
b2df7e7
+	    continue;
b2df7e7
+	    }
b2df7e7
 	    break;
b2df7e7
 	/* breaks copying: mc uses "\0" internally, it must not be changed */
b2df7e7
 	/*case '\\':*/
b2df7e7
@@ -134,6 +145,7 @@ mc_search__translate_replace_glob_to_reg
b2df7e7
 	    break;
b2df7e7
 	}
b2df7e7
 	g_string_append_c (buff, c);
b2df7e7
+	escaped_mode = FALSE;
b2df7e7
     }
b2df7e7
     return buff;
b2df7e7
 }
b2df7e7
@@ -170,7 +182,6 @@ mc_search__run_glob (mc_search_t * lc_mc
b2df7e7
 
b2df7e7
 /* --------------------------------------------------------------------------------------------- */
b2df7e7
 
b2df7e7
-
b2df7e7
 GString *
b2df7e7
 mc_search_glob_prepare_replace_str (mc_search_t * lc_mc_search, GString * replace_str)
b2df7e7
 {
b2df7e7
diff -up mc-4.7.3/lib/search/regex.c.dirname mc-4.7.3/lib/search/regex.c
b2df7e7
--- mc-4.7.3/lib/search/regex.c.dirname	2010-07-05 20:32:41.000000000 +0200
b2df7e7
+++ mc-4.7.3/lib/search/regex.c	2010-09-02 17:19:26.836553568 +0200
b2df7e7
@@ -320,7 +320,7 @@ mc_search_regex__get_max_num_of_replace_
b2df7e7
     gsize loop;
b2df7e7
     for (loop = 0; loop < len - 1; loop++)
b2df7e7
     {
b2df7e7
-        if (str[loop] == '\\' && (str[loop + 1] & (char) 0xf0) == 0x30 /* 0-9 */ )
b2df7e7
+        if (str[loop] == '\\' && g_ascii_isdigit(str[loop + 1]) )
b2df7e7
         {
b2df7e7
             if (strutils_is_char_escaped (str, &str[loop]))
b2df7e7
                 continue;
b2df7e7
@@ -421,9 +421,9 @@ mc_search_regex__process_replace_str (co
b2df7e7
             return -1;
b2df7e7
         }
b2df7e7
 
b2df7e7
-        if ((*(curr_str + 1) & (char) 0xf0) == 0x30)
b2df7e7
+        if ( g_ascii_isdigit(*(curr_str + 1)))
b2df7e7
         {
b2df7e7
-            ret = *(curr_str + 1) - '0';
b2df7e7
+            ret = g_ascii_digit_value (*(curr_str + 1));
b2df7e7
             *skip_len = 2;      /* \\ and one digit */
b2df7e7
             return ret;
b2df7e7
         }
b2df7e7
diff -up mc-4.7.3/lib/strutil/strescape.c.dirname mc-4.7.3/lib/strutil/strescape.c
b2df7e7
--- mc-4.7.3/lib/strutil/strescape.c.dirname	2010-07-05 20:32:41.000000000 +0200
b2df7e7
+++ mc-4.7.3/lib/strutil/strescape.c	2010-09-02 17:19:26.835554197 +0200
b2df7e7
@@ -39,7 +39,7 @@
b2df7e7
 
b2df7e7
 static const char ESCAPE_SHELL_CHARS[] = " !#$%()&{}[]`?|<>;*\\\"'";
b2df7e7
 static const char ESCAPE_REGEX_CHARS[] = "^!#$%()&{}[]`?|<>;*.\\";
b2df7e7
-static const char ESCAPE_GLOB_CHARS[]  = "$*\\";
b2df7e7
+static const char ESCAPE_GLOB_CHARS[]  = "$*\\?";
b2df7e7
 
b2df7e7
 /*** file scope functions ************************************************************************/
b2df7e7