sahib / rmlint

Extremely fast tool to remove duplicates and other lint from your filesystem
http://rmlint.rtfd.org
GNU General Public License v3.0
1.86k stars 128 forks source link

Paranoid mode does not do anything if files are equal? #536

Closed james-cook closed 2 years ago

james-cook commented 2 years ago

I may be reading this wrong but: in "lib/formats/sh.sh":


    # Do double-check if requested:
    if [ -z "$DO_PARANOID_CHECK" ]; then
        return 0
    else
        if [ "$(check_for_equality "$1" "$2")" -ne "0" ]; then
            echo "${COL_RED}^^^^^^ Error: files no longer identical - cancelling.....${COL_RESET}"
            return 1
        fi
    fi
}

Should the code not explicitly "return 0" if the check_for_equality succeeds?

james-cook commented 2 years ago

On testing after just reading the generated script, it seems to work :) Should the code contain more explicit clear returns - or is it OK to leave it like this "fallthru style"?

james-cook commented 2 years ago

Well, it does work! so closing