You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ia...@apache.org on 2014/04/23 20:57:22 UTC
[26/37] git commit: CB-6394: Fix file resolution for the device root
case
CB-6394: Fix file resolution for the device root case
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/4d252e61
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/4d252e61
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/4d252e61
Branch: refs/heads/master
Commit: 4d252e6141ffd1dcf68e191e3de6e3a5019041a7
Parents: ff592f6
Author: Ian Clelland <ic...@chromium.org>
Authored: Thu Apr 3 13:25:42 2014 -0400
Committer: Ian Clelland <ic...@chromium.org>
Committed: Fri Apr 4 13:11:11 2014 -0400
----------------------------------------------------------------------
src/android/LocalFilesystem.java | 2 +-
src/ios/CDVLocalFilesystem.m | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/4d252e61/src/android/LocalFilesystem.java
----------------------------------------------------------------------
diff --git a/src/android/LocalFilesystem.java b/src/android/LocalFilesystem.java
index ac7e189..2ea058a 100644
--- a/src/android/LocalFilesystem.java
+++ b/src/android/LocalFilesystem.java
@@ -38,7 +38,7 @@ public class LocalFilesystem extends Filesystem {
if (questionMark >= 0) {
path = path.substring(0, questionMark);
}
- if (path.endsWith("/")) {
+ if (path.length() > 1 && path.endsWith("/")) {
path = path.substring(0, path.length()-1);
}
return path;
http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/4d252e61/src/ios/CDVLocalFilesystem.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVLocalFilesystem.m b/src/ios/CDVLocalFilesystem.m
index 6b80ad3..3682ab1 100644
--- a/src/ios/CDVLocalFilesystem.m
+++ b/src/ios/CDVLocalFilesystem.m
@@ -99,7 +99,7 @@
NSString *path = nil;
NSString *strippedFullPath = [self stripQueryParametersFromPath:fullPath];
path = [NSString stringWithFormat:@"%@%@", self.fsRoot, strippedFullPath];
- if ([path hasSuffix:@"/"]) {
+ if ([path length] > 1 && [path hasSuffix:@"/"]) {
path = [path substringToIndex:([path length]-1)];
}
return path;