Skip to content

Fix incorrect comments and add missing exit code in test script#32

Open
assisted-by-ai wants to merge 1 commit intoKicksecure:masterfrom
assisted-by-ai:claude/debug-unicode-testscript-bo3HR
Open

Fix incorrect comments and add missing exit code in test script#32
assisted-by-ai wants to merge 1 commit intoKicksecure:masterfrom
assisted-by-ai:claude/debug-unicode-testscript-bo3HR

Conversation

@assisted-by-ai
Copy link
Copy Markdown

Summary

This PR corrects misleading comments in the unicode-testscript that incorrectly described exit codes, and adds a missing exit 1 statement to ensure proper error handling when the trojan-source repository is not found.

Key Changes

  • Fixed comment accuracy: Corrected 5 comments that had inverted or incorrect descriptions of unicode-show and sanitize-string exit codes to match the actual conditional logic
    • Lines 61, 65: Swapped comments describing unicode-show exit codes in the first validation block
    • Line 70: Corrected comment from "unicode-show exit code non-zero" to "unicode-show exit code 0"
    • Line 76: Corrected comment from "unicode-show exit code 0" to "sanitize-string exit code non-zero"
    • Line 86: Corrected comment from "unicode-show exit code 0" to "sanitize-string exit code non-zero"
  • Added missing exit statement: Added exit 1 after the error message when the trojan-source folder is missing (line 100), ensuring the script terminates with an error code instead of continuing execution

Implementation Details

The comments were misleading because they described the opposite of what the conditional statements actually checked. The exit code was missing in the folder validation check, which could allow the script to continue despite a critical dependency being unavailable.

https://claude.ai/code/session_01PfZGFapQ3TpfQYu7tUFYUx

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants