Ticket #3547: mc-3547-cleanup-add2hotlist_cmd-fix-Wformat-nonliteral.patch

File mc-3547-cleanup-add2hotlist_cmd-fix-Wformat-nonliteral.patch, 1.3 KB (added by and, 8 years ago)
  • src/filemanager/hotlist.c

    From da6f2bc159f5aa3115688b92d5594b1c0696e1ae Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Thu, 26 Nov 2015 20:40:07 +0000
    Subject: [PATCH] (add2hotlist_cmd) fix -Wformat-nonliteral
    
    hotlist.c:1576:34: warning: format string is not a string literal [-Wformat-nonliteral]
    
    and remove unnecessary ENABLE_NLS switch
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     src/filemanager/hotlist.c | 9 ++-------
     1 file changed, 2 insertions(+), 7 deletions(-)
    
    diff --git a/src/filemanager/hotlist.c b/src/filemanager/hotlist.c
    index 3c13c34..71cd3f9 100644
    a b void 
    15631563add2hotlist_cmd (void) 
    15641564{ 
    15651565    char *lc_prompt; 
    1566     const char *cp = N_("Label for \"%s\":"); 
    15671566    int l; 
    15681567    char *label_string, *label; 
    15691568 
    1570 #ifdef ENABLE_NLS 
    1571     cp = _(cp); 
    1572 #endif 
    1573  
    1574     l = str_term_width1 (cp); 
     1569    l = str_term_width1 (_("Label for \"%s\":")); 
    15751570    label_string = vfs_path_to_str_flags (current_panel->cwd_vpath, 0, VPF_STRIP_PASSWORD); 
    1576     lc_prompt = g_strdup_printf (cp, str_trunc (label_string, COLS - 2 * UX - (l + 8))); 
     1571    lc_prompt = g_strdup_printf (_("Label for \"%s\":"), str_trunc (label_string, COLS - 2 * UX - (l + 8))); 
    15771572    label = 
    15781573        input_dialog (_("Add to hotlist"), lc_prompt, MC_HISTORY_HOTLIST_ADD, label_string, 
    15791574                      INPUT_COMPLETE_NONE);