Modified code for locating the system.properties file to match how
config.properties location was modified.


git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@529357 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/main/src/main/java/org/apache/felix/main/Main.java b/main/src/main/java/org/apache/felix/main/Main.java
index e190549..04a5496 100644
--- a/main/src/main/java/org/apache/felix/main/Main.java
+++ b/main/src/main/java/org/apache/felix/main/Main.java
@@ -247,14 +247,15 @@
             String classpath = System.getProperty("java.class.path");
             int index = classpath.toLowerCase().indexOf("felix.jar");
             int start = classpath.lastIndexOf(File.pathSeparator, index) + 1;
-            if (index > start)
+            if (index >= start)
             {
+                // Get the path of the felix.jar file.
                 String jarLocation = classpath.substring(start, index);
-                if (jarLocation.length() == 0)
-                {
-                    jarLocation = ".";
-                }
-                confDir = new File(new File(jarLocation).getParent(), "conf");
+                // Calculate the conf directory based on the parent
+                // directory of the felix.jar directory.
+                confDir = new File(
+                    new File(new File(jarLocation).getAbsolutePath()).getParent(),
+                    "conf");
             }
             else
             {