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].

stephan 2022-07-19 13:23 trunk
Commit 62a1688205348d0d41dd08a4665aa05861f70e33a2bb56bf02cc1668dbb8ab53
1 file changed +5 -1
+5 -1
--- src/main.c
+++ src/main.c
@@ -437,11 +437,15 @@
437437
for(i=1; i<g.argc-1; i++){
438438
z = g.argv[i];
439439
if( z[0]!='-' ) continue;
440440
z++;
441441
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. */
443447
if( fossil_strcmp(z, "args")==0 ) break;
444448
}
445449
if( i>=g.argc-1 ) return;
446450
447451
zFileName = g.argv[i+1];
448452
--- 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

Keyboard Shortcuts

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