1
1

Fixed bug with renamig/copying files with backshashes in names

* src/util.c: implementation of new function is_escaped_string
* src/util.h: declaration of new function is_escaped_string
* src/file.c: fix o bug :)
Этот коммит содержится в:
Slava Zanko 2009-01-22 15:19:46 +02:00
родитель 9e46faab7f
Коммит 2cd08d0d84
3 изменённых файлов: 39 добавлений и 38 удалений

Просмотреть файл

@ -179,6 +179,11 @@ do_transform_source (FileOpContext *ctx, const char *source)
for (next_reg = 1, j = 0, k = 0; j < strlen (ctx->dest_mask); j++) {
switch (ctx->dest_mask[j]) {
case '\\':
if (is_escaped_string (&ctx->dest_mask[j])){
fntarget[k++] = ctx->dest_mask[j++];
fntarget[k++] = ctx->dest_mask[j];
break;
} else {
j++;
if (!isdigit ((unsigned char) ctx->dest_mask[j])) {
/* Backslash followed by non-digit */
@ -211,6 +216,7 @@ do_transform_source (FileOpContext *ctx, const char *source)
next_reg = ctx->dest_mask[j] - '0';
/* Fall through */
}
}
case '*':
if (next_reg < 0 || next_reg >= RE_NREGS
@ -1875,12 +1881,6 @@ panel_operate (void *source_panel, FileOperation operation,
dest = temp2;
temp = NULL;
temp2 = source_with_path;
source_with_path = unescape_string(source_with_path);
mhl_mem_free(temp2);
temp2 = dest;
dest = unescape_string(dest);
mhl_mem_free(temp2);
switch (operation) {
case OP_COPY:
/*

Просмотреть файл

@ -1526,4 +1526,3 @@ Q_ (const char *s)
sep = strchr(result, '|');
return (sep != NULL) ? sep + 1 : result;
}

Просмотреть файл

@ -14,8 +14,10 @@ extern char *str_unconst (const char *);
extern const char *cstrcasestr (const char *haystack, const char *needle);
extern const char *cstrstr (const char *haystack, const char *needle);
char *unescape_string ( const char * in );
char *escape_string ( const char * in );
char *unescape_string ( const char * );
char *escape_string ( const char * );
int is_escaped_string ( const char * );
void str_replace(char *s, char from, char to);
int is_printable (int c);
void msglen (const char *text, /*@out@*/ int *lines, /*@out@*/ int *columns);