From: <sk...@us...> - 2003-12-12 21:59:12
|
Update of /cvsroot/sharpcvslib/sharpcvslib/src/ICSharpCode.Console/SharpCvsLib/Console/Parser In directory sc8-pr-cvs1:/tmp/cvs-serv20686/src/ICSharpCode.Console/SharpCvsLib/Console/Parser Modified Files: CommandLineParser.cs Log Message: Fixed the parsing command line with not enough parameters from throwing and out-of-range exception. Index: CommandLineParser.cs =================================================================== RCS file: /cvsroot/sharpcvslib/sharpcvslib/src/ICSharpCode.Console/SharpCvsLib/Console/Parser/CommandLineParser.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** CommandLineParser.cs 11 Dec 2003 05:41:06 -0000 1.18 --- CommandLineParser.cs 12 Dec 2003 21:59:09 -0000 1.19 *************** *** 201,205 **** i++; // get rest of arguments which is options on the commit command. ! while (arguments[i].IndexOf("-", 0, 1) >= 0) { LOGGER.Debug("Parsing arguments. Argument[" + i + "]=[" + arguments[i]); // Get options with second parameters? --- 201,205 ---- i++; // get rest of arguments which is options on the commit command. ! while (arguments.Length > i && arguments[i].IndexOf("-", 0, 1) >= 0) { LOGGER.Debug("Parsing arguments. Argument[" + i + "]=[" + arguments[i]); // Get options with second parameters? *************** *** 244,248 **** i++; // get rest of arguments which is options on the commit command. ! while (arguments[i].IndexOf("-", 0, 1) >= 0) { LOGGER.Debug("Parsing arguments. Argument[" + i + "]=[" + arguments[i]); // Get options with second parameters? --- 244,248 ---- i++; // get rest of arguments which is options on the commit command. ! while (arguments.Length > i && arguments[i].IndexOf("-", 0, 1) >= 0) { LOGGER.Debug("Parsing arguments. Argument[" + i + "]=[" + arguments[i]); // Get options with second parameters? *************** *** 287,291 **** i++; // get rest of arguments which is options on the checkout command. ! while (arguments[i].IndexOf("-", 0, 1) >= 0){ LOGGER.Debug("Parsing arguments. Argument[" + i + "]=[" + arguments[i]); // Get options with second parameters? --- 287,291 ---- i++; // get rest of arguments which is options on the checkout command. ! while (arguments.Length > i && arguments[i].IndexOf("-", 0, 1) >= 0){ LOGGER.Debug("Parsing arguments. Argument[" + i + "]=[" + arguments[i]); // Get options with second parameters? *************** *** 360,364 **** i++; // get rest of arguments which is options on the update command. ! while (arguments[i].IndexOf("-", 0, 1) >= 0) { // Get options with second parameters? if (arguments[i].IndexOfAny( singleOptions.ToCharArray(), 1, 1) >= 0) { --- 360,364 ---- i++; // get rest of arguments which is options on the update command. ! while (arguments.Length > i && arguments[i].IndexOf("-", 0, 1) >= 0) { // Get options with second parameters? if (arguments[i].IndexOfAny( singleOptions.ToCharArray(), 1, 1) >= 0) { *************** *** 401,405 **** this.commandTxt = arguments[i++]; // get rest of arguments which is options on the rtag command. ! while (arguments[i].IndexOf("-", 0, 1) >= 0) { // Get options with second parameters? if (arguments[i].IndexOfAny( singleOptions.ToCharArray(), 1, 1) >= 0) { --- 401,405 ---- this.commandTxt = arguments[i++]; // get rest of arguments which is options on the rtag command. ! while (arguments.Length > i && arguments[i].IndexOf("-", 0, 1) >= 0) { // Get options with second parameters? if (arguments[i].IndexOfAny( singleOptions.ToCharArray(), 1, 1) >= 0) { *************** *** 442,446 **** this.commandTxt = arguments[i++]; // get rest of arguments which is options on the update command. ! while (arguments[i].IndexOf("-", 0, 1) >= 0) { // Get options with second parameters? if (arguments[i].IndexOfAny( singleOptions.ToCharArray(), 1, 1) >= 0) { --- 442,446 ---- this.commandTxt = arguments[i++]; // get rest of arguments which is options on the update command. ! while (arguments.Length > i && arguments[i].IndexOf("-", 0, 1) >= 0) { // Get options with second parameters? if (arguments[i].IndexOfAny( singleOptions.ToCharArray(), 1, 1) >= 0) { |