Ticket #2236: 2236_segfault_in_viewer_stable.patch

File 2236_segfault_in_viewer_stable.patch, 698 bytes (added by andrew_b, 14 years ago)

Patch for 4.7.0-stable branch

  • src/user.c

    diff --git a/src/user.c b/src/user.c
    index ac8a28a..67f6cb4 100644
    a b expand_format (struct WEdit *edit_widget, char c, gboolean do_quote) 
    193193    if (c == '%') 
    194194        return g_strdup ("%"); 
    195195 
    196     if (edit_one_file == NULL) { 
     196    if ((edit_one_file == NULL) && (view_one_file == NULL)) 
     197    { 
    197198        if (g_ascii_islower ((gchar) c)) 
    198199            panel = current_panel; 
    199200        else { 
    expand_format (struct WEdit *edit_widget, char c, gboolean do_quote) 
    204205        fname = panel->dir.list[panel->selected].fname; 
    205206    } 
    206207#ifdef USE_INTERNAL_EDIT 
    207     else 
     208    else if (edit_one_file != NULL) 
    208209        fname = str_unconst (edit_get_file_name (edit_widget)); 
    209210#endif 
    210211