Ticket #3955: mc-3955-utilunix.c-cleanup-Wdangling_else-warning.patch

File mc-3955-utilunix.c-cleanup-Wdangling_else-warning.patch, 1008 bytes (added by and, 4 months ago)
  • lib/utilunix.c

    From a849f2703636c6286477edd049da295dda704fb5 Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Sun, 13 Jan 2019 13:05:31 +0000
    Subject: [PATCH] utilunix.c: Cleanup -Wdangling-else warning
    
    Found by Clang 6.0.1
    
    utilunix.c:865:13: error: add explicit braces to avoid dangling else [-Werror,-Wdangling-else]
                else
                ^
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     lib/utilunix.c | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/lib/utilunix.c b/lib/utilunix.c
    index 07a855713..3f18fbe7a 100644
    a b custom_canonicalize_pathname (char *path, CANON_PATH_FLAGS flags) 
    859859 
    860860    /* Collapse "/./" -> "/" */ 
    861861    if ((flags & CANON_PATH_JOINSLASHES) != 0) 
     862    { 
    862863        for (p = lpath; *p != '\0';) 
    863864            if (IS_PATH_SEP (p[0]) && p[1] == '.' && IS_PATH_SEP (p[2])) 
    864865                str_move (p, p + 2); 
    865866            else 
    866867                p++; 
     868    } 
    867869 
    868870    if ((flags & CANON_PATH_REMSLASHDOTS) != 0) 
    869871    {