Skip to content
Permalink
Browse files
CB-10577: Windows resolveLocalFileSystemURL should omit trailing slas…
…h for file
  • Loading branch information
jasongin committed Mar 9, 2016
1 parent 3e09b31 commit 2132bbf2d8bd1d45f500270b64f348f8ba001b75
Showing 1 changed file with 9 additions and 1 deletion.
@@ -36,7 +36,15 @@ var utils = require('cordova/utils'),
* {FileSystem} filesystem on which the file resides (readonly)
*/
var FileEntry = function(name, fullPath, fileSystem, nativeURL) {
FileEntry.__super__.constructor.apply(this, [true, false, name, fullPath, fileSystem, nativeURL]);
// remove trailing slash if it is present
if (fullPath && /\/$/.test(fullPath)) {
fullPath = fullPath.substring(0, fullPath.length - 1);
}
if (nativeURL && /\/$/.test(nativeURL)) {
nativeURL = nativeURL.substring(0, nativeURL.length - 1);
}

FileEntry.__super__.constructor.apply(this, [true, false, name, fullPath, fileSystem, nativeURL]);
};

utils.extend(FileEntry, Entry);

0 comments on commit 2132bbf

Please sign in to comment.