cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [1/2] cordova-plugin-file git commit: CB-10577: Windows resolveLocalFileSystemURL should omit trailing slash for file
Date Thu, 10 Mar 2016 19:18:42 GMT
Repository: cordova-plugin-file
Updated Branches:
  refs/heads/master 3eae249cc -> f863542a7


CB-10577: Windows resolveLocalFileSystemURL should omit trailing slash for file


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/2132bbf2
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/2132bbf2
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/2132bbf2

Branch: refs/heads/master
Commit: 2132bbf2d8bd1d45f500270b64f348f8ba001b75
Parents: 3e09b31
Author: Jason Ginchereau <jasongin@microsoft.com>
Authored: Wed Mar 9 09:54:44 2016 -0800
Committer: Jason Ginchereau <jasongin@microsoft.com>
Committed: Wed Mar 9 10:00:12 2016 -0800

----------------------------------------------------------------------
 www/FileEntry.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/2132bbf2/www/FileEntry.js
----------------------------------------------------------------------
diff --git a/www/FileEntry.js b/www/FileEntry.js
index a03e37f..c0b7c64 100644
--- a/www/FileEntry.js
+++ b/www/FileEntry.js
@@ -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);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message