mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Check for UNC paths when normalising separators in File::parseAbsolutePath()
This commit is contained in:
parent
a8e592d8a8
commit
c898376158
1 changed files with 8 additions and 1 deletions
|
|
@ -111,10 +111,17 @@ static String normaliseSeparators (const String& path)
|
|||
String separator (File::getSeparatorString());
|
||||
String doubleSeparator (separator + separator);
|
||||
|
||||
auto uncPath = normalisedPath.startsWith (doubleSeparator)
|
||||
&& ! normalisedPath.fromFirstOccurrenceOf (doubleSeparator, false, false).startsWith (separator);
|
||||
|
||||
if (uncPath)
|
||||
normalisedPath = normalisedPath.fromFirstOccurrenceOf (doubleSeparator, false, false);
|
||||
|
||||
while (normalisedPath.contains (doubleSeparator))
|
||||
normalisedPath = normalisedPath.replace (doubleSeparator, separator);
|
||||
|
||||
return normalisedPath;
|
||||
return uncPath ? doubleSeparator + normalisedPath
|
||||
: normalisedPath;
|
||||
}
|
||||
|
||||
bool File::isRoot() const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue