Skip to content

fix(paths): fold env --file/-f operands through the shared argv boundary - #1277

Merged
caomengxuan666 merged 1 commit into
mainfrom
fix/1275
Oct 22, 2026
Merged

caomengxuan666 merged 1 commit into
mainfrom
fix/1275

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Summary

Test plan

  • winuxcmd-tests.exe --gtest_filter=env.* — 39/39 PASSED (MSVC build, scripts/build-with-vs.ps1)
  • New regression test verified failing on the pre-fix binary (env: cannot read env file '/c/...': No such file or directory, exit 1) and passing after

I18N review

No user-visible strings added or changed — the fix only changes which path spelling reaches the filesystem calls; diagnostics still echo the operand text. No catalog update required.

Fixes #1275.
Refs #1230, #1274.

Generated with Devin

env --file opened its operand with a raw ifstream, so MSYS drive-dialect
spellings ("/e/...") decayed to a cwd-drive-relative path and missed the
named file - the same blind spot #1274 closed for sort -T. read_env_file
now resolves the operand once through native_path::normalize_api_operand:
the ifstream and the is_directory classification probe run on the native
spelling while diagnostics keep the caller's text.

Regression test: env -f /x/... through the external path loads the file
and prints its assignments (verified failing before the fix with
"cannot read env file '/c/...': No such file or directory").

Fixes #1275.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@caomengxuan666
caomengxuan666 merged commit bd81a03 into main Oct 22, 2026
8 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/1275 branch October 22, 2026 06:20
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.

[P3][paths] env --file/-f 裸 ifstream 未过共享归一边界(env.cpp:168)——#1274 同类残留

1 participant