} else {
final int iLen = sSource.length();
ArrayList oTokens = new ArrayList();
char cTextQualifier = (char) 0;
char cCurrentChar;
StringBuffer oCurrentToken = new StringBuffer(256);
for (int p=0; p<iLen; p++) {
cCurrentChar = sSource.charAt(p);
switch (cCurrentChar) {
case ' ':
if (0!=cTextQualifier) {
oCurrentToken.append(cCurrentChar);
} else if (oCurrentToken.length()>0) {
oTokens.add(oCurrentToken.toString());
oCurrentToken.setLength(0);
}
break;
case '\\':
if (p==iLen-1) throw new StringIndexOutOfBoundsException("Input string terminated with a single backslash character");
switch (sSource.charAt(++p)) {
case 'n':
oCurrentToken.append('\n');
break;
case 't':
oCurrentToken.append('\t');
break;
case '\\':
oCurrentToken.append('\\');
break;
case '"':
oCurrentToken.append('"');
break;
default:
throw new StringIndexOutOfBoundsException("Unrecognized escape sequence \\"+sSource.charAt(p)+" at "+sSource.substring(p-5>=0 ? p-5 : 0, p+5<=sSource.length()-1 ? p+5 : sSource.length()-1));
} // end switch (charAt(++p))
break;
case '"':
if (0==cTextQualifier) {
cTextQualifier='"';
} else if ('"'==cTextQualifier) {
cTextQualifier=(char)0;
}
break;
case '\'':
if (0==cTextQualifier) {
cTextQualifier='\'';
} else if ('\''==cTextQualifier) {
cTextQualifier=(char)0;
}
break;
case ',':
case ';':
case '(':
case ')':
case '[':
case ']':
case '{':
case '}':
case '-':
case '+':
case '/':
case '*':
case '=':
case '&':
case '!':
case '?':
if (0!=cTextQualifier) {
oCurrentToken.append(cCurrentChar);
}
else {
if (oCurrentToken.length()>0) {
oTokens.add(oCurrentToken.toString());
oCurrentToken.setLength(0);
}
oTokens.add(new String(new char[]{cCurrentChar}));
}
break;
default:
oCurrentToken.append(cCurrentChar);
}
} // next
if (oCurrentToken.length()>0) {
oTokens.add(oCurrentToken.toString());
}
aTokens=new String[oTokens.size()];
System.arraycopy(oTokens.toArray(),0,aTokens,0,aTokens.length);
}
if (DebugFile.trace) {
StringBuffer oOutput = new StringBuffer();
if (aTokens!=null)
for (int t=0; t<aTokens.length; t++)
oOutput.append(aTokens[t]+(t<aTokens.length-1 ? "ΒΆ" :""));
DebugFile.decIdent();
DebugFile.writeln("End Gadgets.tokenizeCmdLine() : " + oOutput.toString());
}
return aTokens;
} // tokenizeCmdLine