Skip to content
Permalink
Browse files

Fixed detection of absolute data folder path on MS Windows

  • Loading branch information...
luccioman committed Nov 18, 2018
1 parent 595e144 commit 7dc1f60619cd340deebe842d833b0eae63fccab8
Showing with 4 additions and 8 deletions.
  1. +4 −8 source/net/yacy/yacy.java
@@ -790,10 +790,8 @@ public static void main(String args[]) {
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 static void main(String args[]) {
} 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]);
}

0 comments on commit 7dc1f60

Please sign in to comment.
You can’t perform that action at this time.