Skip to content

fix: start normally when a command-line argument is not valid UTF-8 - #18

Closed
MotherSphere wants to merge 1 commit into
mainfrom
fix/version-flag-non-utf8-args
Closed

MotherSphere wants to merge 1 commit into
mainfrom
fix/version-flag-non-utf8-args

Conversation

@MotherSphere

Copy link
Copy Markdown
Member

What changed

  • The --version / -V check added in build: publish signed releases through release-please, with --version and no Windows console window #15 read the command line with std::env::args(), which panics when an argument is not valid Unicode. On Linux and macOS a file manager or script passing a Latin-1 path made Avalon abort at startup instead of opening the editor. The check now reads the arguments as OsString (std::env::args_os()), so any argument is accepted and --version behaves as before.
  • A comment in Cargo.toml used an em dash; it is now a comma.

How it was verified

  • Local debug build: avalon --version and avalon -V print avalon 0.1.0 and exit 0; avalon <Latin-1 bytes> --version also prints the version and exits 0 (it panicked before).
  • cargo fmt --check passes. CI runs the three-OS matrix, clippy and MSRV.

The --version check read argv with std::env::args(), which panics on an
argument that is not valid Unicode, so a file manager passing a Latin-1
path aborted Avalon at startup. Read argv as OsString instead. Also
replace an em dash in a Cargo.toml comment.
@MotherSphere

Copy link
Copy Markdown
Member Author

Folded into #20, which carries this commit unchanged and keeps its changelog entry through a commit override.

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.

1 participant