Fossil SCM
Removed the -- flag handling from expand_args_option(), instead letting it fall through to find_option(), to eliminate inconsistencies and corner cases uncovered in [forum:4382bbc66757c39f|forum thread 4382bbc66757c39f].
Commit
62a1688205348d0d41dd08a4665aa05861f70e33a2bb56bf02cc1668dbb8ab53
Parent
e5be71d6acc1aaa…
1 file changed
+5
-1
+5
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -437,11 +437,15 @@ | ||
| 437 | 437 | for(i=1; i<g.argc-1; i++){ |
| 438 | 438 | z = g.argv[i]; |
| 439 | 439 | if( z[0]!='-' ) continue; |
| 440 | 440 | z++; |
| 441 | 441 | if( z[0]=='-' ) z++; |
| 442 | - if( z[0]==0 ) return; /* Stop searching at "--" */ | |
| 442 | + /* Maintenance reminder: we do not stop at a "--" flag here, | |
| 443 | + ** instead delegating that to find_option(). Doing it here | |
| 444 | + ** introduces some weird corner cases, as covered in forum thread | |
| 445 | + ** 4382bbc66757c39f. e.g. (fossil -U -- --args ...) is handled | |
| 446 | + ** differently when we stop at "--" here. */ | |
| 443 | 447 | if( fossil_strcmp(z, "args")==0 ) break; |
| 444 | 448 | } |
| 445 | 449 | if( i>=g.argc-1 ) return; |
| 446 | 450 | |
| 447 | 451 | zFileName = g.argv[i+1]; |
| 448 | 452 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -437,11 +437,15 @@ | |
| 437 | for(i=1; i<g.argc-1; i++){ |
| 438 | z = g.argv[i]; |
| 439 | if( z[0]!='-' ) continue; |
| 440 | z++; |
| 441 | if( z[0]=='-' ) z++; |
| 442 | if( z[0]==0 ) return; /* Stop searching at "--" */ |
| 443 | if( fossil_strcmp(z, "args")==0 ) break; |
| 444 | } |
| 445 | if( i>=g.argc-1 ) return; |
| 446 | |
| 447 | zFileName = g.argv[i+1]; |
| 448 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -437,11 +437,15 @@ | |
| 437 | for(i=1; i<g.argc-1; i++){ |
| 438 | z = g.argv[i]; |
| 439 | if( z[0]!='-' ) continue; |
| 440 | z++; |
| 441 | if( z[0]=='-' ) z++; |
| 442 | /* Maintenance reminder: we do not stop at a "--" flag here, |
| 443 | ** instead delegating that to find_option(). Doing it here |
| 444 | ** introduces some weird corner cases, as covered in forum thread |
| 445 | ** 4382bbc66757c39f. e.g. (fossil -U -- --args ...) is handled |
| 446 | ** differently when we stop at "--" here. */ |
| 447 | if( fossil_strcmp(z, "args")==0 ) break; |
| 448 | } |
| 449 | if( i>=g.argc-1 ) return; |
| 450 | |
| 451 | zFileName = g.argv[i+1]; |
| 452 |