summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2013-06-19 15:10:59 -0400
committerJames Moger <james.moger@gitblit.com>2013-06-19 15:10:59 -0400
commitdaaf89d8bc0b8229c6205d0c59326bee183c5c5e (patch)
tree19f66d5d5fb29fd876b94dbe580328f31c801a6a
parent15cb305fbd441f0d7b3e7261d956472db3718417 (diff)
downloadgitblit-daaf89d8bc0b8229c6205d0c59326bee183c5c5e.tar.gz
gitblit-daaf89d8bc0b8229c6205d0c59326bee183c5c5e.zip
Fixed IOOB exception in StringUtils.getRelativePath (issue-256)
-rw-r--r--src/main/java/com/gitblit/utils/StringUtils.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/com/gitblit/utils/StringUtils.java b/src/main/java/com/gitblit/utils/StringUtils.java
index 86823db5..cff3577d 100644
--- a/src/main/java/com/gitblit/utils/StringUtils.java
+++ b/src/main/java/com/gitblit/utils/StringUtils.java
@@ -331,7 +331,7 @@ public class StringUtils {
String fp = fullPath.replace('\\', '/').toLowerCase();
if (fp.startsWith(bp)) {
String relativePath = fullPath.substring(basePath.length()).replace('\\', '/');
- if (relativePath.charAt(0) == '/') {
+ if (relativePath.length() > 0 && relativePath.charAt(0) == '/') {
relativePath = relativePath.substring(1);
}
return relativePath;