• Masahiro Yamada's avatar
    fixdep: refactor parse_dep_file() · 87b95a81
    Masahiro Yamada authored
    parse_dep_file() has too much indentation, and puts the code far to
    the right.  This commit refactors the code and reduces the one level
    of indentation.
    
    strrcmp() computes 'slen' by itself, but the caller already knows the
    length of the token, so 'slen' can be passed via function argument.
    With this, we can swap the order of strrcmp() and "*p = \0;"
    
    Also, strrcmp() is an ambiguous function name.  Flip the logic and
    rename it to str_ends_with().
    
    I added a new helper is_ignored_file() - this returns 1 if the token
    represents a file that should be ignored.
    Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
    87b95a81
fixdep.c 10.3 KB