Differences From:
File
src/main.c
part of check-in
[f80303ac73]
- fix option/argument parsing for the case where an option is missing a required argument.
by
bharder on
2009-02-09 18:09:03.
[view]
To:
File
src/main.c
part of check-in
[d63f87c003]
- Fix a C89 violation in main.c.
by
drh on
2009-03-22 13:44:43.
[view]
@@ -332,10 +332,11 @@
const char *zReturn = 0;
assert( hasArg==0 || hasArg==1 );
nLong = strlen(zLong);
for(i=2; i<g.argc; i++){
+ char *z;
if (i+hasArg >= g.argc) break;
- char *z = g.argv[i];
+ z = g.argv[i];
if( z[0]!='-' ) continue;
z++;
if( z[0]=='-' ){
if( z[1]==0 ){