Ticket #1574: mc-1574.patch

File mc-1574.patch, 872 bytes (added by alsroot, 15 years ago)
  • src/tty/color.c

    From 5715b0aa0ed25551e25ed7f9183dac5c609e7ea2 Mon Sep 17 00:00:00 2001
    From: Aleksey Lim <alsroot@member.fsf.org>
    Date: Sun, 30 Aug 2009 17:07:47 +0000
    Subject: mc crashes while setting tty colors #1574
    
    ---
     src/tty/color.c |    8 +++++++-
     1 files changed, 7 insertions(+), 1 deletions(-)
    
    diff --git a/src/tty/color.c b/src/tty/color.c
    index 3cd8e12..e4fcb5e 100644
    a b configure_colors_string (const char *the_color_string) 
    8383        char *e; 
    8484 
    8585        cfb = g_strsplit_set (*p, "=,", 3); 
     86        p++; 
     87 
     88        if (cfb[0] == NULL) { 
     89                g_strfreev (cfb); 
     90                continue; 
     91        } 
     92 
    8693        /* append '=' to the entry name */ 
    8794        e = g_strdup_printf ("%s=", cfb[0]); 
    8895        g_free (cfb[0]); 
    configure_colors_string (const char *the_color_string) 
    102109            } 
    103110 
    104111        g_strfreev (cfb); 
    105         p++; 
    106112    } 
    107113 
    108114   g_strfreev (color_strings);