From 8035313d43e0446d730592c4f1cb68b9f26a989b Mon Sep 17 00:00:00 2001 From: aroberson Date: Wed, 15 Apr 2015 20:49:26 -0500 Subject: [PATCH] Corrected logic to build native URL to check for forward slash on native and path variables --- src/windows/FileProxy.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/windows/FileProxy.js b/src/windows/FileProxy.js index f62cdc875..5c86ad39a 100644 --- a/src/windows/FileProxy.js +++ b/src/windows/FileProxy.js @@ -122,7 +122,13 @@ var WinFS = function(name, root) { this.winpath += "/"; } this.makeNativeURL = function(path) { - return encodeURI(this.root.nativeURL + sanitize(path.replace(':','%3A')));}; + if (/\/$/.test(this.root.nativeURL) && /^\//.test(path)) + { + return encodeURI(this.root.nativeURL + sanitize(path.slice(1).replace(':', '%3A'))); + } else { + return encodeURI(this.root.nativeURL + sanitize(path.replace(':', '%3A'))); + } + }; root.fullPath = '/'; if (!root.nativeURL) root.nativeURL = 'file://'+sanitize(this.winpath + root.fullPath).replace(':','%3A');