Fossil SCM

Fixing the long opt broke final short option if expected argument is not present.

preben 2023-09-29 06:56 find-options-last-arg-fix
Commit d8b23d71c9161c943c021630b0899672ef4b9f094ed0934226c0c0fa30956124
1 file changed +1
+1
--- src/main.c
+++ src/main.c
@@ -1047,10 +1047,11 @@
10471047
zReturn = g.argv[i+hasArg];
10481048
remove_from_argv(i, 1+hasArg);
10491049
break;
10501050
}
10511051
}else if( fossil_strcmp(z,zShort)==0 ){
1052
+ if( i+hasArg >= g.argc ) break;
10521053
zReturn = g.argv[i+hasArg];
10531054
remove_from_argv(i, 1+hasArg);
10541055
break;
10551056
}
10561057
}
10571058
--- src/main.c
+++ src/main.c
@@ -1047,10 +1047,11 @@
1047 zReturn = g.argv[i+hasArg];
1048 remove_from_argv(i, 1+hasArg);
1049 break;
1050 }
1051 }else if( fossil_strcmp(z,zShort)==0 ){
 
1052 zReturn = g.argv[i+hasArg];
1053 remove_from_argv(i, 1+hasArg);
1054 break;
1055 }
1056 }
1057
--- src/main.c
+++ src/main.c
@@ -1047,10 +1047,11 @@
1047 zReturn = g.argv[i+hasArg];
1048 remove_from_argv(i, 1+hasArg);
1049 break;
1050 }
1051 }else if( fossil_strcmp(z,zShort)==0 ){
1052 if( i+hasArg >= g.argc ) break;
1053 zReturn = g.argv[i+hasArg];
1054 remove_from_argv(i, 1+hasArg);
1055 break;
1056 }
1057 }
1058

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button