From: <fd...@us...> - 2007-02-14 19:59:49
|
Revision: 3125 http://jnode.svn.sourceforge.net/jnode/?rev=3125&view=rev Author: fduminy Date: 2007-02-14 11:59:46 -0800 (Wed, 14 Feb 2007) Log Message: ----------- fixed bug found when typing "locale <tab>" (infinite loop?) Modified Paths: -------------- trunk/shell/src/shell/org/jnode/shell/help/argument/ListArgument.java Modified: trunk/shell/src/shell/org/jnode/shell/help/argument/ListArgument.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/help/argument/ListArgument.java 2007-02-11 22:32:31 UTC (rev 3124) +++ trunk/shell/src/shell/org/jnode/shell/help/argument/ListArgument.java 2007-02-14 19:59:46 UTC (rev 3125) @@ -64,9 +64,12 @@ StringBuilder result = new StringBuilder(toStringArgument(items.iterator().next())); for (T item : items) { - while (!isPartOfArgument(item, result.toString())) { + while ((result.length() != 0) && + !isPartOfArgument(item, result.toString())) + { // shorten the result until it matches - result = result.deleteCharAt(result.length()); + // remove the last character : + result.setLength(result.length() - 1); } } log.debug("\nresult="+result); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |