Skip to content

Reject whitespace in relative interpreter paths#7

Open
jeet-dekivadia wants to merge 1 commit into
twosigma:mainfrom
jeet-dekivadia:codex/reject-whitespace-relative-paths
Open

Reject whitespace in relative interpreter paths#7
jeet-dekivadia wants to merge 1 commit into
twosigma:mainfrom
jeet-dekivadia:codex/reject-whitespace-relative-paths

Conversation

@jeet-dekivadia

@jeet-dekivadia jeet-dekivadia commented May 30, 2026

Copy link
Copy Markdown

Summary

  • reject relative interpreter tokens containing spaces or tabs so behavior does not depend on kernel shebang splitting rules
  • keep the C, Rust, and reference Python implementations aligned on the short-term contract
  • document the restriction and add shared regression coverage for both ambiguous whitespace characters

Fixes #4

Validation

  • git diff --check
  • rustfmt --edition 2018 --check rust/src/main.rs

Remote Linux validation

  • git diff --check
  • cargo fmt --manifest-path rust/Cargo.toml -- --check
  • python3 test_relexec.py

Signed-off-by: Jeet Dekivadia <jeet.university@gmail.com>
@jeet-dekivadia

Copy link
Copy Markdown
Author

Small follow-up while this is waiting for review. The patch is intentionally symmetric across the C parser, Rust parser, and Python reference harness: the only new rejection is a relative interpreter token containing a space or tab, because those tokens are ambiguous across shebang splitting paths.

Validation from preparation: git diff --check; cargo fmt --manifest-path rust/Cargo.toml -- --check; python3 test_relexec.py. The added shared regressions cover both ambiguous whitespace characters.

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.

Refuse to act if argv[1] contains spaces

1 participant