-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Remove PathSearchTrimEnd #18166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove PathSearchTrimEnd #18166
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1473,7 +1473,7 @@ private static CanDoPathLookupResult CanDoPathLookup(string possiblePath) | |
| /// <summary> | ||
| /// The command name to search for. | ||
| /// </summary> | ||
| private string _commandName; | ||
| private readonly string _commandName; | ||
|
|
||
| /// <summary> | ||
| /// Determines which command types will be globbed. | ||
|
|
@@ -1536,7 +1536,6 @@ private void setupPathSearcher() | |
| if (_canDoPathLookupResult == CanDoPathLookupResult.Yes) | ||
| { | ||
| _canDoPathLookup = true; | ||
| _commandName = _commandName.TrimEnd(Utils.Separators.PathSearchTrimEnd); | ||
|
|
||
| _pathSearcher = | ||
| new CommandPathSearch( | ||
|
|
@@ -1561,7 +1560,6 @@ private void setupPathSearcher() | |
|
|
||
| if (!string.IsNullOrEmpty(fileName)) | ||
| { | ||
| fileName = fileName.TrimEnd(Utils.Separators.PathSearchTrimEnd); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like we should have a test for this? With this we should now be able to call executables that have trailing whitespace? (although seems like a bad practice)
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test what? In common, it is impossible to know what is OS and file system limitations. As .Net team concluded, the best thing we can do is to defer checks to OS and file system.
I don't see any changes in behavior on Windows in my manual tests. |
||
| _pathSearcher = | ||
| new CommandPathSearch( | ||
| fileName, | ||
|
|
@@ -1601,7 +1599,6 @@ private void setupPathSearcher() | |
|
|
||
| if (!string.IsNullOrEmpty(fileName)) | ||
| { | ||
| fileName = fileName.TrimEnd(Utils.Separators.PathSearchTrimEnd); | ||
| _pathSearcher = | ||
| new CommandPathSearch( | ||
| fileName, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reviewers: this fixes a violation
IDE0044: Add readonly modifier, enabled in #13880.