Ticket #2014: 0001-Don-t-try-to-make-directory-NULL-named-in-mkdir_cmd.patch

File 0001-Don-t-try-to-make-directory-NULL-named-in-mkdir_cmd.patch, 904 bytes (added by cosoleto, 14 years ago)
  • src/cmd.c

    From f29af95a6d3cea2d9bf930b7f5c1fe99026475c6 Mon Sep 17 00:00:00 2001
    From: Francesco Cosoleto <cosoleto@gmail.com>
    Date: Tue, 9 Feb 2010 03:49:20 +0100
    Subject: [PATCH 1/2] Don't try to make directory NULL named in mkdir_cmd().
    
    As input_expand_dialog() may return a pointer to an empty string,
    the function was trying to create a directory so named and thus
    print a false "File exists" error message.
    
    Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
    ---
     src/cmd.c |    2 ++
     1 files changed, 2 insertions(+), 0 deletions(-)
    
    diff --git a/src/cmd.c b/src/cmd.c
    index ba7b792..2c4f2d7 100644
    a b mkdir_cmd (void) 
    400400    if (!dir) 
    401401        return; 
    402402 
     403    if (*dir) { 
    403404    if (dir[0] == '/' || dir[0] == '~') 
    404405        absdir = g_strdup (dir); 
    405406    else 
    mkdir_cmd (void) 
    415416    } 
    416417 
    417418    g_free (absdir); 
     419    } 
    418420    g_free (dir); 
    419421} 
    420422