gcc-wrapper: HOMEBREW_PREFIX の test をクォート(常に真になるガードの修正) - #175
Open
k-yoshimi wants to merge 2 commits into
Open
Conversation
Unquoted, "[ -n ${HOMEBREW_PREFIX} ]" expands to "[ -n ]" when the
variable is empty, which is always true, so the guard never failed
and the version loop probed paths like /bin/gcc-14.
Fixes #169
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Collaborator
Author
AI review cycle (Codex + Antigravity) 結果Phase 1 (Codex): must_fix 0 / should_fix 0 / optional 0。brew 不在時に FOUND=0 経路で正しく exit 127 することを確認。 Phase 2 (Antigravity): must_fix_docs 0。指摘への対応:
→ 両フェーズ収束。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
Fixes #169
tools/gcc-wrapper/install.shの[ -n ${HOMEBREW_PREFIX} ]は、変数が空のとき[ -n ]に展開され、POSIX の 1 引数 test(文字列-n自体が非空 → 真)として 常に真 になっていました。16 行目の[ -z ${HOMEBREW_PREFIX} ]も同型(こちらは偶然正しく動作)。両方をクォートしました。検証
sh -nで構文チェック OKunset X; [ -n ${X} ]が真になること(バグ)、[ -n "${X}" ]が偽になること(修正後)を sh で確認済み🤖 Generated with Claude Code