mirror of
https://github.com/sqlite/sqlite.git
synced 2025-12-24 14:17:58 +03:00
Add the catchcmd_collapse_space command and use it to help make shell testing
more robust against TCL space escapes. FossilOrigin-Name: 93caabb66082f76ef161a51ac822b919517a7171
This commit is contained in:
@@ -823,6 +823,17 @@ proc catchcmd {db {cmd ""}} {
|
||||
list $rc $msg
|
||||
}
|
||||
|
||||
proc catchcmd_collapse_space {db {cmd ""}} {
|
||||
global CLI
|
||||
set out [open cmds.txt w]
|
||||
puts $out $cmd
|
||||
close $out
|
||||
set line "exec $CLI $db < cmds.txt"
|
||||
set rc [catch { eval $line } msg]
|
||||
regsub -all {\s+} $msg { } msg
|
||||
list $rc $msg
|
||||
}
|
||||
|
||||
proc catchcmdex {db {cmd ""}} {
|
||||
global CLI
|
||||
set out [open cmds.txt w]
|
||||
|
||||
Reference in New Issue
Block a user