mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-02 22:37:50 +00:00
Fixed GetParent() on windows and unix (was incorrect for directories whose paths end in a separator).
This commit is contained in:
parent
99ecfeb9bb
commit
7910e844e2
@ -178,6 +178,7 @@ void nsFileSpec::GetParent(nsFileSpec& outSpec) const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
outSpec.mPath = mPath;
|
||||
outSpec.mPath[outSpec.mPath.Length() - 1] = '\0'; // avoid trailing separator, if any
|
||||
char* cp = strrchr(outSpec.mPath, '/');
|
||||
if (cp++)
|
||||
*cp = '\0';
|
||||
|
@ -222,6 +222,7 @@ void nsFileSpec::GetParent(nsFileSpec& outSpec) const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
outSpec.mPath = mPath;
|
||||
outSpec.mPath[outSpec.mPath.Length() - 1] = '\0';; // avoid trailing separator, if any
|
||||
char* cp = strrchr(outSpec.mPath, '\\');
|
||||
if (cp++)
|
||||
*cp = '\0';
|
||||
|
@ -178,6 +178,7 @@ void nsFileSpec::GetParent(nsFileSpec& outSpec) const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
outSpec.mPath = mPath;
|
||||
outSpec.mPath[outSpec.mPath.Length() - 1] = '\0'; // avoid trailing separator, if any
|
||||
char* cp = strrchr(outSpec.mPath, '/');
|
||||
if (cp++)
|
||||
*cp = '\0';
|
||||
|
@ -222,6 +222,7 @@ void nsFileSpec::GetParent(nsFileSpec& outSpec) const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
outSpec.mPath = mPath;
|
||||
outSpec.mPath[outSpec.mPath.Length() - 1] = '\0';; // avoid trailing separator, if any
|
||||
char* cp = strrchr(outSpec.mPath, '\\');
|
||||
if (cp++)
|
||||
*cp = '\0';
|
||||
|
Loading…
x
Reference in New Issue
Block a user