Skip to content

Commit 1bb411b

Browse files
committed
CB-6571 add trailing space it is missing in DirectoryEnty constructor.
1 parent 7674211 commit 1bb411b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

www/DirectoryEntry.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,16 @@ var argscheck = require('cordova/argscheck'),
3636
* {FileSystem} filesystem on which the directory resides (readonly)
3737
*/
3838
var DirectoryEntry = function(name, fullPath, fileSystem, nativeURL) {
39-
DirectoryEntry.__super__.constructor.call(this, false, true, name, fullPath, fileSystem, nativeURL);
39+
40+
// add trailing slash if it is missing
41+
if (!/\/$/.test(fullPath)) {
42+
fullPath += "/";
43+
}
44+
// add trailing slash if it is missing
45+
if (!/\/$/.test(nativeURL)) {
46+
nativeURL += "/";
47+
}
48+
DirectoryEntry.__super__.constructor.call(this, false, true, name, fullPath, fileSystem, nativeURL);
4049
};
4150

4251
utils.extend(DirectoryEntry, Entry);

0 commit comments

Comments
 (0)