Ticket #4050: mc-4050-tree.c-remove-unreachable-code.patch

File mc-4050-tree.c-remove-unreachable-code.patch, 1.2 KB (added by and, 7 months ago)
  • src/filemanager/tree.c

    From 1ac2344aadd5080d42aa293e8d0fc71e54db0c02 Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Fri, 3 Apr 2020 09:18:43 +0000
    Subject: [PATCH] (tree.c): Remove unreachable code
    
    Found by Clang 9.0.1
    
    tree.c:1107:10: error: code will never be executed [-Werror,-Wunreachable-code]
        if (!command_prompt && ((key >= ' ' && key <= 255) || key == KEY_BACKSPACE))
             ^~~~~~~~~~~~~~
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     src/filemanager/tree.c | 10 ----------
     1 file changed, 10 deletions(-)
    
    diff --git a/src/filemanager/tree.c b/src/filemanager/tree.c
    index 7f925992b..a1c52f267 100644
    a b tree_key (WTree * tree, int key) 
    11021102        tree_execute_cmd (tree, command); 
    11031103        return MSG_HANDLED; 
    11041104    } 
    1105  
    1106     /* Do not eat characters not meant for the tree below ' ' (e.g. C-l). */ 
    1107     if (!command_prompt && ((key >= ' ' && key <= 255) || key == KEY_BACKSPACE)) 
    1108     { 
    1109         tree_start_search (tree); 
    1110         tree_do_search (tree, key); 
    1111         return MSG_HANDLED; 
    1112     } 
    1113  
    1114     return MSG_NOT_HANDLED; 
    11151105} 
    11161106 
    11171107/* --------------------------------------------------------------------------------------------- */