__unix__: do simple tilde subst ( ~/ --> /home/user) just in case this was not done by the shell

This commit is contained in:
Stefan Schippers 2020-10-27 22:56:53 +01:00
parent 5706b12ad9
commit 73bab32aa9
1 changed files with 4 additions and 1 deletions

View File

@ -1446,7 +1446,10 @@ int Tcl_AppInit(Tcl_Interp *inter)
char f[PATH_MAX];
#ifdef __unix__
if(filename[0] !='/') {
if(filename[0] == '~' && filename[1] == '/') {
here();
my_snprintf(f, S(f), "%s%s", home_dir, filename + 1);
} else if(filename[0] !='/') {
my_snprintf(f, S(f), "%s/%s", pwd_dir, filename);
} else {
my_snprintf(f, S(f), "%s", filename);