1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Fix argument expansion in sqlite-tclsh on Windows such that if an argument

does not match a filename even after glob expansion, it is appended to the
argument list verbatim.

FossilOrigin-Name: cd942dce148c9d8f5a94cee61923aad8d1b732b807e004005f78323be30c02e7
This commit is contained in:
drh
2024-11-16 17:39:34 +00:00
parent 50faa8d17e
commit 18689b8fb2
3 changed files with 11 additions and 8 deletions

View File

@ -4037,9 +4037,12 @@ static const char *tclsh_main_loop(void){
"if {[file exists $arg]} {\n"
"lappend new $arg\n"
"} else {\n"
"set once 0\n"
"foreach match [lsort [glob -nocomplain $arg]] {\n"
"lappend new $match\n"
"set once 1\n"
"}\n"
"if {!$once} {lappend new $arg}\n"
"}\n"
"}\n"
"set argv $new\n"