summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluccioman <luccioman@users.noreply.github.com>2018-11-18 10:03:41 +0100
committerluccioman <luccioman@users.noreply.github.com>2018-11-18 10:08:20 +0100
commit7dc1f60619cd340deebe842d833b0eae63fccab8 (patch)
treeaa6c44fef4ea055027658b3d6da92a9f0bbd4824
parent595e144797aac6c630450fea68ae5de6e23cf821 (diff)
Fixed detection of absolute data folder path on MS Windows
-rw-r--r--source/net/yacy/yacy.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/source/net/yacy/yacy.java b/source/net/yacy/yacy.java
index cf4985fb3..12ed27c9b 100644
--- a/source/net/yacy/yacy.java
+++ b/source/net/yacy/yacy.java
@@ -790,10 +790,8 @@ public final class yacy {
if ((args.length >= 1) && (args[0].toLowerCase(Locale.ROOT).equals("-startup") || args[0].equals("-start"))) {
// normal start-up of yacy
if (args.length > 1) {
- if(args[1].startsWith(File.separator)) {
- /* data root folder provided as an absolute path */
- dataRoot = new File(args[1]);
- } else {
+ dataRoot = new File(args[1]);
+ if(!dataRoot.isAbsolute()) {
/* data root folder provided as a path relative to the user home folder */
dataRoot = new File(System.getProperty("user.home").replace('\\', '/'), args[1]);
}
@@ -803,10 +801,8 @@ public final class yacy {
} else if (args.length >= 1 && args[0].toLowerCase(Locale.ROOT).equals("-gui")) {
// start-up of yacy with gui
if (args.length > 1) {
- if(args[1].startsWith(File.separator)) {
- /* data root folder provided as an absolute path */
- dataRoot = new File(args[1]);
- } else {
+ dataRoot = new File(args[1]);
+ if(!dataRoot.isAbsolute()) {
/* data root folder provided as a path relative to the user home folder */
dataRoot = new File(System.getProperty("user.home").replace('\\', '/'), args[1]);
}