[Pkg-mc-commits] r458 - in trunk/debian: . patches patches/upstream

Patrick Winnertz winnie at alioth.debian.org
Wed Sep 8 13:10:15 UTC 2010


Author: winnie
Date: 2010-09-08 13:10:07 +0000 (Wed, 08 Sep 2010)
New Revision: 458

Added:
   trunk/debian/patches/upstream/
   trunk/debian/patches/upstream/01_prevent_crash_in_bogus_dirs.patch
Modified:
   trunk/debian/changelog
   trunk/debian/patches/series
Log:
Work on a new version with some backports



Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2010-09-08 12:45:57 UTC (rev 457)
+++ trunk/debian/changelog	2010-09-08 13:10:07 UTC (rev 458)
@@ -1,3 +1,12 @@
+mc (3:4.7.0.9-2) unstable; urgency=low
+
+  * Fixed build-dep from on libslang2 from < to <<
+    < is deprecated
+  * backport fix to prevent crash while copying to bogus dirs
+    (Closes: #592396)
+
+ -- Patrick Winnertz <winnie at debian.org>  Wed, 08 Sep 2010 15:07:44 +0200
+
 mc (3:4.7.0.9-1) unstable; urgency=low
 
   [Yury V. Zaytsev]

Modified: trunk/debian/patches/series
===================================================================
--- trunk/debian/patches/series	2010-09-08 12:45:57 UTC (rev 457)
+++ trunk/debian/patches/series	2010-09-08 13:10:07 UTC (rev 458)
@@ -8,3 +8,4 @@
 debian/20_wrong_path_to_wrappers.patch
 debian/84_use_dvicat_instead_of_dvi2tty.patch
 debian/99_detect_alt_editor.patch
+upstream/01_prevent_crash_in_bogus_dirs.patch

Added: trunk/debian/patches/upstream/01_prevent_crash_in_bogus_dirs.patch
===================================================================
--- trunk/debian/patches/upstream/01_prevent_crash_in_bogus_dirs.patch	                        (rev 0)
+++ trunk/debian/patches/upstream/01_prevent_crash_in_bogus_dirs.patch	2010-09-08 13:10:07 UTC (rev 458)
@@ -0,0 +1,225 @@
+Description: Prevent a crash while copying to bogus directory, e.g '????'
+Bug-Debian: http://bugs.debian.org/592396
+Author: Patrick Winnertz <winnie at debian.org>
+
+diff -Nurwd orig/mc-4.7.0.9/lib/search/glob.c mc-4.7.0.9/lib/search/glob.c
+--- orig/mc-4.7.0.9/lib/search/glob.c	2010-09-07 08:53:07.000000000 +0200
++++ mc-4.7.0.9/lib/search/glob.c	2010-09-08 14:51:56.035638360 +0200
+@@ -54,31 +54,37 @@
+     gsize orig_len = *len;
+     gsize loop = 0;
+     gboolean inside_group = FALSE;
+-    while (loop < orig_len) {
+-        switch (str[loop]) {
++    while (loop < orig_len)
++    {
++        switch (str[loop])
++        {
+         case '*':
+-            if (!strutils_is_char_escaped (str, &(str[loop]))) {
++            if (!strutils_is_char_escaped (str, &(str[loop])))
++            {
+                 g_string_append (buff, (inside_group) ? ".*" : "(.*)");
+                 loop++;
+                 continue;
+             }
+             break;
+         case '?':
+-            if (!strutils_is_char_escaped (str, &(str[loop]))) {
++            if (!strutils_is_char_escaped (str, &(str[loop])))
++            {
+                 g_string_append (buff, (inside_group) ? "." : "(.)");
+                 loop++;
+                 continue;
+             }
+             break;
+         case ',':
+-            if (!strutils_is_char_escaped (str, &(str[loop]))) {
++            if (!strutils_is_char_escaped (str, &(str[loop])))
++            {
+                 g_string_append (buff, "|");
+                 loop++;
+                 continue;
+             }
+             break;
+         case '{':
+-            if (!strutils_is_char_escaped (str, &(str[loop]))) {
++            if (!strutils_is_char_escaped (str, &(str[loop])))
++            {
+                 g_string_append (buff, "(");
+                 inside_group = TRUE;
+                 loop++;
+@@ -86,7 +92,8 @@
+             }
+             break;
+         case '}':
+-            if (!strutils_is_char_escaped (str, &(str[loop]))) {
++            if (!strutils_is_char_escaped (str, &(str[loop])))
++            {
+                 g_string_append (buff, ")");
+                 inside_group = FALSE;
+                 loop++;
+@@ -116,16 +123,29 @@
+ static GString *
+ mc_search__translate_replace_glob_to_regex (gchar *str)
+ {
+-    GString *buff = g_string_new ("");
++    GString *buff = g_string_sized_new (32);
+     int cnt = '0';
+-
+-    while (*str) {
++    gboolean escaped_mode = FALSE;
++    while (*str)
++    {
+ 	char c = *str++;
+-	switch (c) {
++        switch (c)
++        {
++        case '\\':
++            if (!escaped_mode)
++            {
++                escaped_mode = TRUE;
++            }
++            g_string_append_c (buff, c);
++            continue;
+ 	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 +154,7 @@
+ 	    break;
+ 	}
+ 	g_string_append_c (buff, c);
++        escaped_mode = FALSE;
+     }
+     return buff;
+ }
+@@ -149,7 +170,8 @@
+ 
+     g_string_free (mc_search_cond->str, TRUE);
+ 
+-    if (lc_mc_search->is_entire_line) {
++    if (lc_mc_search->is_entire_line)
++    {
+         g_string_prepend_c (tmp, '^');
+         g_string_append_c (tmp, '$');
+     }
+@@ -170,7 +192,6 @@
+ 
+ /* --------------------------------------------------------------------------------------------- */
+ 
+-
+ GString *
+ mc_search_glob_prepare_replace_str (mc_search_t * lc_mc_search, GString * replace_str)
+ {
+diff -Nurwd orig/mc-4.7.0.9/lib/search/regex.c mc-4.7.0.9/lib/search/regex.c
+--- orig/mc-4.7.0.9/lib/search/regex.c	2010-09-07 08:53:07.000000000 +0200
++++ mc-4.7.0.9/lib/search/regex.c	2010-09-08 14:59:18.499570196 +0200
+@@ -296,7 +296,7 @@
+     int max_token = 0;
+     gsize loop;
+     for (loop = 0; loop < len - 1; loop++) {
+-        if (str[loop] == '\\' && (str[loop + 1] & (char) 0xf0) == 0x30 /* 0-9 */ ) {
++        if (str[loop] == '\\' && g_ascii_isdigit(str[loop + 1])  ) {
+             if (strutils_is_char_escaped (str, &str[loop]))
+                 continue;
+             if (max_token < str[loop + 1] - '0')
+@@ -390,8 +390,8 @@
+             return -1;
+         }
+ 
+-        if ((*(curr_str + 1) & (char) 0xf0) == 0x30) {
+-            ret = *(curr_str + 1) - '0';
++        if ( g_ascii_isdigit(*(curr_str +1)) ) {
++            ret = g_ascii_digit_value(*(curr_str + 1));
+             *skip_len = 2;      /* \\ and one digit */
+             return ret;
+         }
+diff -Nurwd orig/mc-4.7.0.9/lib/strutil/strescape.c mc-4.7.0.9/lib/strutil/strescape.c
+--- orig/mc-4.7.0.9/lib/strutil/strescape.c	2010-09-07 08:53:07.000000000 +0200
++++ mc-4.7.0.9/lib/strutil/strescape.c	2010-09-08 14:18:43.763641294 +0200
+@@ -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 ************************************************************************/
+ 
+@@ -63,9 +63,12 @@
+     if (src_len == (gsize)-1)
+         src_len = strlen (src);
+ 
+-    for (curr_index = 0; curr_index < src_len; curr_index++) {
+-        if (escape_non_printable) {
+-            switch (src[curr_index]) {
++    for (curr_index = 0; curr_index < src_len; curr_index++)
++    {
++        if (escape_non_printable)
++        {
++            switch (src[curr_index])
++            {
+             case '\n':
+                 g_string_append (ret, "\\n");
+                 continue;
+@@ -108,14 +111,18 @@
+     if (src_len == (gsize)-1)
+         src_len = strlen (src);
+ 
+-    for (curr_index = 0; curr_index < src_len-1; curr_index++) {
+-        if (src[curr_index] != '\\'){
++    for (curr_index = 0; curr_index < src_len - 1; curr_index++)
++    {
++        if (src[curr_index] != '\\')
++        {
+             g_string_append_c (ret, src[curr_index]);
+             continue;
+         }
+         curr_index++;
+-        if (unescape_non_printable) {
+-            switch (src[curr_index]) {
++        if (unescape_non_printable)
++        {
++            switch (src[curr_index])
++            {
+             case 'n':
+                 g_string_append_c (ret, '\n');
+                 continue;
+@@ -139,6 +146,7 @@
+ 
+     return g_string_free (ret, FALSE);
+ }
++
+ /* --------------------------------------------------------------------------------------------- */
+ 
+ /** To be compatible with the general posix command lines we have to escape
+@@ -228,7 +236,8 @@
+         return FALSE;
+ 
+     current--;
+-    while (current >= start && *current == '\\') {
++    while (current >= start && *current == '\\')
++    {
+         num_esc++;
+         current--;
+     }
+diff -Nurwd orig/mc-4.7.0.9/src/file.c mc-4.7.0.9/src/file.c
+--- orig/mc-4.7.0.9/src/file.c	2010-09-07 08:53:08.000000000 +0200
++++ mc-4.7.0.9/src/file.c	2010-09-08 14:18:52.292583517 +0200
+@@ -812,7 +812,7 @@
+     struct link *lp;
+     char *d;
+ 
+-    d = strutils_shell_unescape (_d);
++    d = g_strdup (_d);
+ 
+     /* First get the mode of the source dir */
+   retry_src_stat:




More information about the Pkg-mc-commits mailing list