Skip to content

Commit

Permalink
System.Configuration: Trim trailing periods from directory names in C…
Browse files Browse the repository at this point in the history
…lientConfigPaths.

Signed-off-by: Connor McAdams <[email protected]>
  • Loading branch information
Conmanx360 committed Jan 22, 2024
1 parent 5261e58 commit f40918e
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,16 @@ private string Validate(string str, bool limitSize) {
if (limitSize) {
validated = (validated.Length > MAX_LENGTH_TO_USE) ? validated.Substring(0, MAX_LENGTH_TO_USE) : validated;
}

/*
* For Mono compatibility:
* Mono creates/accesses the generated user configuration file paths
* through a different set of API calls than referencesource does.
* As a result of this, the trailing period in directory names is
* not truncated, which results in an inability to access the user
* configuration file. We'll add a workaround for this here.
*/
validated = validated.TrimEnd('.');
}

return validated;
Expand Down

0 comments on commit f40918e

Please sign in to comment.