Handled the case in which environment variable HOME is not set.
See github issue tracker issue #490. There were two cases: When running without the Tk console, a NULL value was being passed to a string comparison. When running with the Tk console, two variables were not initialized. Both prolems have been fixed.
This commit is contained in:
parent
22e182f908
commit
e5a6cf0df9
|
|
@ -249,6 +249,9 @@ proc ::tkcon::Init {} {
|
||||||
if {![info exists PRIV(histfile)]} {
|
if {![info exists PRIV(histfile)]} {
|
||||||
set PRIV(histfile) [file join $env($envHome) $histfile]
|
set PRIV(histfile) [file join $env($envHome) $histfile]
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
set PRIV(rcfile) ""
|
||||||
|
set PRIV(histfile) ""
|
||||||
}
|
}
|
||||||
|
|
||||||
## Handle command line arguments before sourcing resource file to
|
## Handle command line arguments before sourcing resource file to
|
||||||
|
|
|
||||||
|
|
@ -988,7 +988,8 @@ mainInitFinal()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getcwd(cwd, 512) == NULL || strcmp(cwd, home) || (RCFileName[0] == '/'))
|
if (getcwd(cwd, 512) == NULL || ((home != NULL) && (strcmp(cwd, home)))
|
||||||
|
|| (RCFileName[0] == '/'))
|
||||||
{
|
{
|
||||||
/* Read in the .magicrc file from the current directory, if */
|
/* Read in the .magicrc file from the current directory, if */
|
||||||
/* different from HOME. */
|
/* different from HOME. */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue