diff options
| author | apnadkarni <apnmbx-wits@yahoo.com> | 2023-02-25 07:35:21 (GMT) |
|---|---|---|
| committer | apnadkarni <apnmbx-wits@yahoo.com> | 2023-02-25 07:35:21 (GMT) |
| commit | 8390c51fcaeaa278ec7ec40ec5d31ee187c25208 (patch) | |
| tree | 593650d44026aa996a6edc70f5425421a1668709 | |
| parent | d5e9da898f0655a0ef37989c28bef7c129ed3c50 (diff) | |
| download | tcl-8390c51fcaeaa278ec7ec40ec5d31ee187c25208.zip tcl-8390c51fcaeaa278ec7ec40ec5d31ee187c25208.tar.gz tcl-8390c51fcaeaa278ec7ec40ec5d31ee187c25208.tar.bz2 | |
Fix [1d074b177a]. Failure to read .tclshrc
| -rw-r--r-- | unix/tclAppInit.c | 11 | ||||
| -rw-r--r-- | win/tclAppInit.c | 7 |
2 files changed, 11 insertions, 7 deletions
diff --git a/unix/tclAppInit.c b/unix/tclAppInit.c index 05d25de..e3d95bc 100644 --- a/unix/tclAppInit.c +++ b/unix/tclAppInit.c @@ -158,15 +158,16 @@ Tcl_AppInit( * is the name of the application. If this line is deleted then no * user-specific startup file will be run under any conditions. */ - #ifdef DJGPP - Tcl_ObjSetVar2(interp, Tcl_NewStringObj("tcl_rcFileName", TCL_INDEX_NONE), NULL, - Tcl_NewStringObj("~/tclsh.rc", TCL_INDEX_NONE), TCL_GLOBAL_ONLY); +#define INITFILENAME "tclshrc.tcl" #else - Tcl_ObjSetVar2(interp, Tcl_NewStringObj("tcl_rcFileName", TCL_INDEX_NONE), NULL, - Tcl_NewStringObj("~/.tclshrc", TCL_INDEX_NONE), TCL_GLOBAL_ONLY); +#define INITFILENAME ".tclshrc" #endif + (void)Tcl_EvalEx(interp, + "set tcl_rcFileName [file tildeexpand ~/" INITFILENAME "]", + -1, + TCL_EVAL_GLOBAL); return TCL_OK; } diff --git a/win/tclAppInit.c b/win/tclAppInit.c index 30127fd..077500a 100644 --- a/win/tclAppInit.c +++ b/win/tclAppInit.c @@ -215,8 +215,11 @@ Tcl_AppInit( * user-specific startup file will be run under any conditions. */ - Tcl_ObjSetVar2(interp, Tcl_NewStringObj("tcl_rcFileName", TCL_INDEX_NONE), NULL, - Tcl_NewStringObj("~/tclshrc.tcl", TCL_INDEX_NONE), TCL_GLOBAL_ONLY); + (void)Tcl_EvalEx(interp, + "set tcl_rcFileName [file tildeexpand ~/tclshrc.tcl]", + -1, + TCL_EVAL_GLOBAL); + return TCL_OK; } |
