Skip to content

Commit 3d6fa49

Browse files
author
drh
committed
Bug fix in the revised ".prompt" command of the CLI, with test cases.
FossilOrigin-Name: 7583385593354f90a9818d1820543841109f253dffcec5ca5ed7629336e29fac
1 parent 4df365e commit 3d6fa49

5 files changed

Lines changed: 34 additions & 11 deletions

File tree

manifest

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
C Fix\sa\stypo\swhich\scauses\s.headers\sto\snot\sshow\sup\sin\sthe\sshell's\s.help.
2-
D 2026-04-12T05:41:28.196
1+
C Bug\sfix\sin\sthe\srevised\s".prompt"\scommand\sof\sthe\sCLI,\swith\stest\scases.
2+
D 2026-04-12T10:46:35.358
33
F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
44
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
55
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -735,7 +735,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
735735
F src/resolve.c 928ff887f2a7c64275182060d94d06fdddbe32226c569781cf7e7edc6f58d7fd
736736
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
737737
F src/select.c ffe199f025a0dd74670d2a77232bdea364a4d7b36f32c64a6572d39ba6a11576
738-
F src/shell.c.in 7015b5176723b405228d154adc4ab09cc9165d13c6eb0a6cac81c7a624354d52
738+
F src/shell.c.in 917bfdcb8a1c2980b8e10fceded37f0dcdd77138d42f3acf0f98bb8f251c0bf3
739739
F src/sqlite.h.in a5605faa9479bbaac16c4ab43eb09ff50632004a8e05084d3fde56063ef73766
740740
F src/sqlite3.rc 015537e6ac1eec6c7050e17b616c2ffe6f70fca241835a84a4f0d5937383c479
741741
F src/sqlite3ext.h 9788c301f95370fa30e808861f1d2e6f022a816ddbe2a4f67486784c1b31db2e
@@ -1619,8 +1619,8 @@ F test/sharedA.test 64bdd21216dda2c6a3bd3475348ccdc108160f34682c97f2f51c19fc0e21
16191619
F test/sharedB.test 1a84863d7a2204e0d42f2e1606577c5e92e4473fa37ea0f5bdf829e4bf8ee707
16201620
F test/shared_err.test 32634e404a3317eeb94abc7a099c556a346fdb8fb3858dbe222a4cbb8926a939
16211621
F test/sharedlock.test 5ede3c37439067c43b0198f580fd374ebf15d304
1622-
F test/shell-prompt.sql 44b4aa9642ad21c11266c2e2c0d4538d40ca7ecf284366e4e20aeda51c6c674f
1623-
F test/shell1.test eda2e527435f139224dda67db6bbd2466597408d4fe5883d647d67fa32d88f7c
1622+
F test/shell-prompt.sql b91e31fd768a88a1b978c3d3527e408bbee605075aacabada785935c43ceacb7
1623+
F test/shell1.test c84eff209f93ad17ccdf7e1634969fc8231684254edeb21d9b13d67c3179cdb5
16241624
F test/shell2.test dc541d2681503e55466a24d35a4cbf8ca5b90b8fcdef37fc4db07373a67d31d3
16251625
F test/shell3.test 91efdd545097a61a1f72cf79c9ad5b49da080f3f10282eaf4c3c272cd1012db2
16261626
F test/shell4.test e25580a792b7b54560c3a76b6968bd8189261f38979fe28e6bc6312c5db280db
@@ -2198,8 +2198,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee
21982198
F tool/warnings.sh a554d13f6e5cf3760f041b87939e3d616ec6961859c3245e8ef701d1eafc2ca2
21992199
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
22002200
F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c
2201-
P 79a8d3edf8207d72f0c4650272ee239a1c7783a07f907fbf0cf5a7ad99b27a2a
2202-
R 6afa10144d14b7e5e96dae0f054c0256
2203-
U stephan
2204-
Z ca30e3bd4093e367574a6fcc62815006
2201+
P d379b14a48d331933240fb99ab43c3cc978638d7ad0a8d5975bb211a72eaef2b
2202+
R 413e6a5c20c2985fcff77c23e5334689
2203+
U drh
2204+
Z 4948fc5038d38765ec0c91a2ed0fedcc
22052205
# Remove this line to create a well-formed Fossil manifest.

manifest.uuid

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
d379b14a48d331933240fb99ab43c3cc978638d7ad0a8d5975bb211a72eaef2b
1+
7583385593354f90a9818d1820543841109f253dffcec5ca5ed7629336e29fac

src/shell.c.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10700,6 +10700,7 @@ static int do_meta_command(const char *zLine, ShellState *p){
1070010700
}else{
1070110701
free(p->azPrompt[cnt]);
1070210702
p->azPrompt[cnt] = strdup(z);
10703+
cnt++;
1070310704
}
1070410705
}
1070510706
}else

test/shell-prompt.sql

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,27 @@
3131
Main prompt: 'SQLite /f> '
3232
Continuation: '/B.../H> '
3333
END
34+
.testcase 111
35+
.prompt 'abc> ' '123> ' -show
36+
.check <<END
37+
Main prompt: 'abc> '
38+
Continuation: '123> '
39+
END
40+
.testcase 112
41+
.prompt -- --first --second
42+
.prompt --show
43+
.check <<END
44+
Main prompt: '--first'
45+
Continuation: '--second'
46+
END
47+
.testcase 113
48+
.prompt --reset --show
49+
.check <<END
50+
Main prompt: 'SQLite /f> '
51+
Continuation: '/B.../H> '
52+
END
53+
54+
3455

3556
.testcase 1000
3657
SELECT shell_prompt_test(NULL);

test/shell1.test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,8 @@ do_test shell1-3.17.3 {
548548
do_test shell1-3.17.4 {
549549
# too many arguments
550550
catchcmd "test.db" ".prompt FOO BAR BAD"
551-
} {0 {}}
551+
} {1 {line 1: .prompt FOO BAR BAD
552+
line 1: ^--- extra argument}}
552553

553554
# .quit Exit this program
554555
do_test shell1-3.18.1 {

0 commit comments

Comments
 (0)