Fix escaping of UNC project paths containing spaces - #38719
Open
innwayyy wants to merge 1 commit into
Open
Conversation
- Preserve consecutive backslashes unless quoting requires escaping - Add regression coverage for UNC paths containing spaces Fixes dotnet#38675
Author
|
@dotnet-policy-service agree |
There was a problem hiding this comment.
Pull request overview
Fixes incorrect escaping of backslashes in dotnet-ef argument-string generation for quoted (space-containing) UNC paths, ensuring the leading \\SERVER prefix is preserved when invoking dotnet msbuild.
Changes:
- Adjusted
Exe.ToArgumentsto emit pending backslashes verbatim when they are not escaping a"or the closing quote. - Updated the existing argument-escaping unit test expectation to match correct backslash handling.
- Added a regression test covering UNC paths with spaces to prevent reintroducing the
\\\\SERVERbehavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/dotnet-ef/Exe.cs | Fixes backslash emission logic so quoted UNC paths keep the \\ prefix (no unintended doubling). |
| test/dotnet-ef.Tests/ExeTest.cs | Updates existing expectation and adds a targeted regression test for UNC-prefix handling. |
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 #38675
dotnet-efincorrectly escaped backslashes in UNC project paths when generating thedotnet msbuildargument list. As a result, paths starting with\\FILESERVERwere passed as\\\\FILESERVER.This change preserves the UNC prefix while continuing to quote paths containing spaces.
A regression test was added that fails before the fix and passes after it.