From 4de7e398696bc4c5d7d0d09daa8b3a4eaef9726e Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 1 Apr 2026 16:29:15 +0000 Subject: [PATCH] Fix missing exit and incorrect comments in unicode-testscript Add missing 'exit 1' when $HOME/trojan-source directory is not found, which previously caused the script to continue and fail confusingly. Fix swapped exit-code comments in process_file and correct comments that referenced unicode-show when the tested command was sanitize-string. https://claude.ai/code/session_01PfZGFapQ3TpfQYu7tUFYUx --- unicode-testscript | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/unicode-testscript b/unicode-testscript index c1decdcd..2e6f8719 100755 --- a/unicode-testscript +++ b/unicode-testscript @@ -58,23 +58,23 @@ process_file() { fi if cat -- "$file_name" | unicode-show >/dev/null ; then - ## unicode-show exit code non-zero. + ## unicode-show exit code 0. printf "%s\n" "$0: ERROR: Failed to find unicode using 'unicode-show' (stdin check) in file '$file_name'." >&2 exit 1 fi - ## unicode-show exit code 0. + ## unicode-show exit code non-zero. ## 'stcatn' should sanitize. Therefore 'unicode-show' should not find any unicode and exit 0. ## Check if there is a non-zero exit code in this pipe, because if so, that's a bug. if ! stcatn "$file_name" | unicode-show >/dev/null ; then - ## unicode-show exit code 0. + ## unicode-show exit code non-zero. printf "%s\n" "$0: ERROR: Failed to sanitize string using 'stcatn' in file '$file_name'." >&2 exit 1 fi - ## unicode-show non-zero exit code. + ## unicode-show exit code 0. if ! cat -- "$file_name" | sanitize-string nolimit >/dev/null ; then - ## unicode-show exit code 0. + ## sanitize-string exit code non-zero. printf "%s\n" "$0: ERROR: Failed to sanitize string using 'sanitize-string' (stdin check) in file '$file_name'." >&2 exit 1 fi @@ -83,7 +83,7 @@ process_file() { file_content="$(cat -- "$file_name")" if ! sanitize-string nolimit "$file_content" >/dev/null ; then - ## unicode-show exit code 0. + ## sanitize-string exit code non-zero. printf "%s\n" "$0: ERROR: Failed to sanitize string using 'sanitize-string' (command check) in file '$file_name'." >&2 exit 1 fi @@ -97,6 +97,7 @@ $0: ERROR: Folder '$HOME/trojan-source' missing. To get it: cd ~ git clone git@github.com:nickboucher/trojan-source.git" >&2 + exit 1 fi ## Creates files: