Fix crash on empty command line arguments
This commit is contained in:
parent
f3b4722e4f
commit
f5628dd5b3
@ -285,8 +285,7 @@ bool dontLoadCache ( int argc, char **argv )
|
||||
#if ECLIPSE_ARGS
|
||||
currParam = currParam.substr (1, currParam.length() - 2);
|
||||
#endif
|
||||
|
||||
if ( currParam.at (0) == '-' && currParam.at (1) == 'q' ) {
|
||||
if ( currParam.length() > 1 && currParam.at(0) == '-' && currParam.at(1) == 'q' ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -317,6 +316,9 @@ int processLineParams ( int argc, char **argv )
|
||||
|
||||
for ( int iArg = 1; iArg < argc; iArg++) {
|
||||
Glib::ustring currParam (argv[iArg]);
|
||||
if ( currParam.empty() ) {
|
||||
continue;
|
||||
}
|
||||
#if ECLIPSE_ARGS
|
||||
currParam = currParam.substr (1, currParam.length() - 2);
|
||||
#endif
|
||||
|
@ -122,6 +122,9 @@ int processLineParams ( int argc, char **argv )
|
||||
{
|
||||
for ( int iArg = 1; iArg < argc; iArg++) {
|
||||
Glib::ustring currParam (argv[iArg]);
|
||||
if ( currParam.empty() ) {
|
||||
continue;
|
||||
}
|
||||
#if ECLIPSE_ARGS
|
||||
currParam = currParam.substr (1, currParam.length() - 2);
|
||||
#endif
|
||||
@ -697,4 +700,3 @@ int main (int argc, char **argv)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user