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

Merge the latest trunk changes into the sessions branch.

FossilOrigin-Name: 2277c70b6f14e2f8043112a5c49a8bc18b7504f3
This commit is contained in:
dan
2012-03-19 11:17:17 +00:00
37 changed files with 408 additions and 134 deletions

View File

@ -19,6 +19,7 @@
#
# Commands to manipulate the db and the file-system at a high level:
#
# get_pwd
# copy_file FROM TO
# delete_file FILENAME
# drop_all_tables ?DB?
@ -148,6 +149,24 @@ proc getFileRetryDelay {} {
return $::G(file-retry-delay)
}
# Return the string representing the name of the current directory. On
# Windows, the result is "normalized" to whatever our parent command shell
# is using to prevent case-mismatch issues.
#
proc get_pwd {} {
if {$::tcl_platform(platform) eq "windows"} {
#
# NOTE: Cannot use [file normalize] here because it would alter the
# case of the result to what Tcl considers canonical, which would
# defeat the purpose of this procedure.
#
return [string map [list \\ /] \
[string trim [exec -- $::env(ComSpec) /c echo %CD%]]]
} else {
return [pwd]
}
}
# Copy file $from into $to. This is used because some versions of
# TCL for windows (notably the 8.4.1 binary package shipped with the
# current mingw release) have a broken "file copy" command.
@ -990,7 +1009,7 @@ proc crashsql {args} {
# $crashfile gets compared to the native filename in
# cfSync(), which can be different then what TCL uses by
# default, so here we force it to the "nativename" format.
set cfile [string map {\\ \\\\} [file nativename [file join [pwd] $crashfile]]]
set cfile [string map {\\ \\\\} [file nativename [file join [get_pwd] $crashfile]]]
set f [open crash.tcl w]
puts $f "sqlite3_crash_enable 1"