Fossil SCM

In the "fossil chat send" command, detect extra arguments and throw an error if they are seen.

drh 2021-01-05 02:05 trunk
Commit 1814f528de4987ed807f885abc3b9f08f1e1d999dc4122cc00764719f6e4c4f8
1 file changed +3
+3
--- src/chat.c
+++ src/chat.c
@@ -767,10 +767,13 @@
767767
}
768768
if( !g.url.isHttps && !allowUnsafe ){
769769
fossil_fatal("URL \"%s\" is unencrypted. Use https:// instead", zUrl);
770770
}
771771
verify_all_options();
772
+ if( g.argc>3 ){
773
+ fossil_fatal("unknown extra argument: \"%s\"", g.argv[3]);
774
+ }
772775
i = (int)strlen(g.url.path);
773776
while( i>0 && g.url.path[i-1]=='/' ) i--;
774777
g.url.path = mprintf("%.*s/chat-send", i, g.url.path);
775778
blob_init(&up, 0, 0);
776779
blob_init(&down, 0, 0);
777780
--- src/chat.c
+++ src/chat.c
@@ -767,10 +767,13 @@
767 }
768 if( !g.url.isHttps && !allowUnsafe ){
769 fossil_fatal("URL \"%s\" is unencrypted. Use https:// instead", zUrl);
770 }
771 verify_all_options();
 
 
 
772 i = (int)strlen(g.url.path);
773 while( i>0 && g.url.path[i-1]=='/' ) i--;
774 g.url.path = mprintf("%.*s/chat-send", i, g.url.path);
775 blob_init(&up, 0, 0);
776 blob_init(&down, 0, 0);
777
--- src/chat.c
+++ src/chat.c
@@ -767,10 +767,13 @@
767 }
768 if( !g.url.isHttps && !allowUnsafe ){
769 fossil_fatal("URL \"%s\" is unencrypted. Use https:// instead", zUrl);
770 }
771 verify_all_options();
772 if( g.argc>3 ){
773 fossil_fatal("unknown extra argument: \"%s\"", g.argv[3]);
774 }
775 i = (int)strlen(g.url.path);
776 while( i>0 && g.url.path[i-1]=='/' ) i--;
777 g.url.path = mprintf("%.*s/chat-send", i, g.url.path);
778 blob_init(&up, 0, 0);
779 blob_init(&down, 0, 0);
780

Keyboard Shortcuts

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