Revision: 3564
          http://jnode.svn.sourceforge.net/jnode/?rev=3564&view=rev
Author:   lsantha
Date:     2007-10-20 13:11:31 -0700 (Sat, 20 Oct 2007)

Log Message:
-----------
Fixed the filename completion behaviour for the root directory: / .

Modified Paths:
--------------
    trunk/shell/src/shell/org/jnode/shell/help/argument/FileArgument.java

Modified: trunk/shell/src/shell/org/jnode/shell/help/argument/FileArgument.java
===================================================================
--- trunk/shell/src/shell/org/jnode/shell/help/argument/FileArgument.java       
2007-10-20 19:37:35 UTC (rev 3563)
+++ trunk/shell/src/shell/org/jnode/shell/help/argument/FileArgument.java       
2007-10-20 20:11:31 UTC (rev 3564)
@@ -83,7 +83,9 @@
         // Get last full directory
         final int idx = partial.lastIndexOf(File.separatorChar);
         final String dir;
-        if (idx >= 0) {
+        if(idx == 0){
+            dir = String.valueOf(File.separatorChar);
+        } else if (idx > 0) {
             dir = partial.substring(0, idx);
         } else {
             dir = "";
@@ -107,7 +109,8 @@
             return partial;
         } else {
             final ArrayList<String> list = new ArrayList<String>(names.length);
-            final String prefix = (dir.length() == 0) ? "" : dir + 
File.separatorChar;
+            final String prefix = (dir.length() == 0) ? "" :
+                    dir.equals("/") ? "/" : dir + File.separatorChar;
             for (String n : names) {
                 final String name = prefix + n;
                 if (name.startsWith(partial)) {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Jnode-svn-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jnode-svn-commits

Reply via email to