author | David Rajchenbach-Teller <dteller@mozilla.com> |
Fri, 24 Aug 2012 16:18:16 -0400 | |
changeset 103344 | f6ec0707def6e9348e563e84b2945fc74bdfc921 |
parent 103343 | c97a5e95e1aeb2d1d2ba14d9b32935d917279c68 |
child 103345 | e1700d9065d832c1fb179ff6fa6c37f0189d34b4 |
push id | 13945 |
push user | ryanvm@gmail.com |
push date | Fri, 24 Aug 2012 20:18:14 +0000 |
treeherder | mozilla-inbound@b3c861bd1e2f [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | taras |
bugs | 783676 |
milestone | 17.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
toolkit/components/osfile/ospath_unix_back.jsm | file | annotate | diff | comparison | revisions | |
toolkit/components/osfile/ospath_win_back.jsm | file | annotate | diff | comparison | revisions |
--- a/toolkit/components/osfile/ospath_unix_back.jsm +++ b/toolkit/components/osfile/ospath_unix_back.jsm @@ -96,23 +96,28 @@ if (typeof Components != "undefined") { case "..": if (stack.length == 0) { if (absolute) { throw new Error("Path is ill-formed: attempting to go past root"); } else { stack.push(".."); } } else { - stack.pop(); + if (stack[stack.length - 1] == "..") { + stack.push(".."); + } else { + stack.pop(); + } } break; default: stack.push(v); } }); + exports.OS.Shared.LOG("normalize", "stack", stack.toSource()); let string = stack.join("/"); return absolute ? "/" + string : string; }, /** * Return the components of a path. * You should generally apply this function to a normalized path. * * @return {{
--- a/toolkit/components/osfile/ospath_win_back.jsm +++ b/toolkit/components/osfile/ospath_win_back.jsm @@ -192,17 +192,21 @@ if (typeof Components != "undefined") { case "..": if (stack.length == 0) { if (absolute) { throw new Error("Path is ill-formed: attempting to go past root"); } else { stack.push(".."); } } else { - stack.pop(); + if (stack[stack.length - 1] == "..") { + stack.push(".."); + } else { + stack.pop(); + } } break; default: stack.push(v); } }); // Put everything back together