Skip to content

Commit

Permalink
Fix #3264: Do not allow zero-length segments in CleanUpName: Escape p…
Browse files Browse the repository at this point in the history
…ath separator characters at the start of a segment.
  • Loading branch information
siegfriedpammer committed Aug 17, 2024
1 parent 4864ef4 commit e8a9227
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ static string CleanUpName(string text, bool separateAtDots, bool treatAsFileName
if (separateAtDots)
currentSegmentLength = 0;
}
else if (treatAsFileName && (c == '/' || c == '\\') && currentSegmentLength > 0)
else if (treatAsFileName && (c == '/' || c == '\\') && currentSegmentLength > 1)
{
// if we treat this as a file name, we've started a new segment
b.Append(c);
Expand Down

0 comments on commit e8a9227

Please sign in to comment.