Ticket #305: 0001-Ticket-305-dont-work-rename-copy-on-some-chars.patch

File 0001-Ticket-305-dont-work-rename-copy-on-some-chars.patch, 1.2 KB (added by angel_il, 15 years ago)

rebased on current master

  • src/file.c

    From dc6cf0b6fab1b3b013950ed418a9aeacec55681d Mon Sep 17 00:00:00 2001
    From: Ilia Maslakov <il.smind@gmail.com>
    Date: Mon, 15 Jun 2009 20:48:42 +0000
    Subject: [PATCH] Ticket #305 (dont work rename/copy on some chars)
    
    fix: incorrect work rename/copy
    ---
     src/file.c |    5 ++---
     1 files changed, 2 insertions(+), 3 deletions(-)
    
    diff --git a/src/file.c b/src/file.c
    index e453fe2..24b15ca 100644
    a b transform_source (FileOpContext *ctx, const char *source) 
    153153    char *s = g_strdup (source); 
    154154    char *q; 
    155155    const char *fnsource = x_basename (s); 
    156     size_t j=0, len; 
     156    char *fnsource_fixed = g_strdup (fnsource); 
    157157 
    158158    /* We remove \n from the filename since regex routines would use \n as an anchor */ 
    159159    /* this is just to be allowed to maniupulate file names with \n on it */ 
    transform_source (FileOpContext *ctx, const char *source) 
    163163    } 
    164164 
    165165    str_fix_string (fnsource); 
    166     len = strlen (fnsource); 
    167166 
    168     if ( !( mc_search_run(ctx->search_handle, fnsource, 0, len, &j) && j == len) ){ 
     167    if ( ! mc_search_run(ctx->search_handle, fnsource_fixed, 0, strlen(fnsource_fixed), NULL) ){ 
    169168        transform_error = FILE_SKIP; 
    170169        g_free (s); 
    171170        return NULL;