[Pkg-mc-commits] r74 - trunk/debian/proposed-patches

winnie at alioth.debian.org winnie at alioth.debian.org
Wed Feb 27 09:42:21 UTC 2008


Author: winnie
Date: 2008-02-27 09:42:20 +0000 (Wed, 27 Feb 2008)
New Revision: 74

Added:
   trunk/debian/proposed-patches/fix-01-copymove.patch
Log:
Patch from Rostilav Benes on mc-devel to fix copying to fs with other encoding


Added: trunk/debian/proposed-patches/fix-01-copymove.patch
===================================================================
--- trunk/debian/proposed-patches/fix-01-copymove.patch	                        (rev 0)
+++ trunk/debian/proposed-patches/fix-01-copymove.patch	2008-02-27 09:42:20 UTC (rev 74)
@@ -0,0 +1,55 @@
+diff -rupbBN mc.orig/src/file.c mc/src/file.c
+--- mc.orig/src/file.c	2007-11-16 10:15:44.000000000 +0100
++++ mc/src/file.c	2007-11-22 16:08:31.000000000 +0100
+@@ -172,7 +172,8 @@ static const char *
+ do_transform_source (FileOpContext *ctx, const char *source)
+ {
+     size_t j, len;
+-    char *fnsource = (char*) x_basename (source);
++    const char *fnsource = x_basename (source);
++    char *fnsource_fixed = g_strdup (fnsource);
+     int next_reg;
+     enum CaseConvs case_conv = NO_CONV;
+     static char fntarget[MC_MAXPATHLEN];
+@@ -181,14 +182,16 @@ do_transform_source (FileOpContext *ctx,
+     char *actual;
+     size_t remain;
+ 
+-    str_fix_string (fnsource);
+ 
+-    len = strlen (fnsource);
+-    j = re_match (&ctx->rx, fnsource, len, 0, &ctx->regs);
++    str_fix_string (fnsource_fixed);
++
++    len = strlen (fnsource_fixed);
++    j = re_match (&ctx->rx, fnsource_fixed, len, 0, &ctx->regs);
+     if (j != len) {
+ 	transform_error = FILE_SKIP;
+ 	return NULL;
+     }
++    g_free (fnsource_fixed);
+     
+     actual = fntarget;
+     remain = sizeof (fntarget);
+@@ -236,10 +239,19 @@ do_transform_source (FileOpContext *ctx,
+ 		return NULL;
+ 	    }
+ 	    for (fn = fnsource + ctx->regs.start[next_reg]; 
+-                        fn < fnsource + ctx->regs.end[next_reg] && remain > 1; 
+-                        str_next_char (&fn))
++                 fn < fnsource + ctx->regs.end[next_reg] && remain > 1; ) {
++		
++                if (str_is_valid_char (fn, -1) == 1) {
+ 		convert_case (fn, &case_conv, &actual, &remain);
++                    str_next_char (&fn);
++                } else {
++                    actual[0] = fn[0];
++                    actual++;
++                    remain--;
++                    fn++;
++                }
+             
++            }
+ 	    next_reg++;
+ 	    break;
+ 




More information about the Pkg-mc-commits mailing list