1
0
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:
drh
2016-03-25 17:09:16 +00:00
parent ddb2b4a310
commit 5729c31daf
4 changed files with 21 additions and 12 deletions

View File

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