Repository navigation
fix(paths): fold env --file/-f operands through the shared argv boundary - #1277
Merged
Merged
Conversation
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>
1 of 3 tasks
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.
Summary
env --file/-fopened its operand with a rawstd::ifstreamoutside the shared argv normalization boundary, so MSYS drive-dialect spellings (/e/..., also/cygdrive/X,/mnt/X) decayed to a cwd-drive-relative path and missed the named file — the same blind spot fix(paths): resolve bare MSYS drive-root operands through the shared argv boundary (#1230) #1274 closed forsort -T.read_env_filenow resolves the operand once throughnative_path::normalize_api_operand: theifstreamand theis_directoryclassification probe run on the native spelling, while diagnostics keep the caller's text (df convention from fix(paths): resolve bare MSYS drive-root operands through the shared argv boundary (#1230) #1274).env -f /x/...through the external path loads the file and prints its assignments.Test plan
winuxcmd-tests.exe --gtest_filter=env.*— 39/39 PASSED (MSVC build,scripts/build-with-vs.ps1)env: cannot read env file '/c/...': No such file or directory, exit 1) and passing afterI18N 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