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

Update test helper procedure 'get_pwd' to handle the ComSpec environment variable being absent.

FossilOrigin-Name: fe1979552f43e0526f16481457e01981f29707401f77079f9854a8d91b35b5a4
This commit is contained in:
mistachkin
2021-01-18 19:27:56 +00:00
parent abc6b67aff
commit f3ebea8114
4 changed files with 24 additions and 13 deletions

View File

@ -174,8 +174,14 @@ proc get_pwd {} {
# case of the result to what Tcl considers canonical, which would
# defeat the purpose of this procedure.
#
if {[info exists ::env(ComSpec)]} {
set comSpec $::env(ComSpec)
} else {
# NOTE: Hard-code the typical default value.
set comSpec {C:\Windows\system32\cmd.exe}
}
return [string map [list \\ /] \
[string trim [exec -- $::env(ComSpec) /c echo %CD%]]]
[string trim [exec -- $comSpec /c echo %CD%]]]
} else {
return [pwd]
}