Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #511 from adobe/glenn/issue-84
Browse files Browse the repository at this point in the history
Unescape URI when converting to native path.
  • Loading branch information
chrisbank committed Mar 30, 2012
2 parents 805d7c8 + 9baaf47 commit 0b4eb97
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/file/FileUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

/*jslint vars: true, plusplus: true, devel: true, browser: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */
/*global define: false, $: false, FileError: false, brackets: false */
/*global define, $, FileError, brackets, unescape */

/**
* Set of utilites for working with files and text content.
Expand Down Expand Up @@ -154,13 +154,14 @@ define(function (require, exports, module) {

/**
* Convert a URI path to a native path.
* On the mac, this is a no-op
* On both platforms, this unescapes the URI
* On windows, URI paths start with a "/", but have a drive letter ("C:"). In this
* case, remove the initial "/".
* @param {!string} path
* @return {string}
*/
function convertToNativePath(path) {
path = unescape(path);
if (path.indexOf(":") !== -1 && path[0] === "/") {
return path.substr(1);
}
Expand Down

0 comments on commit 0b4eb97

Please sign in to comment.