Overview
| Artifact ID: | b66194d492f355aab50097321d74b3da91cec3e2 |
|---|---|
| Ticket: | 3432962fffffffffffffffffffffffffffffffff
Some noninteractive invocations of tclsh still run .tclshrc |
| User & Date: | karll on 2011-11-03 20:16:54 |
Changes
- assignee changed to: "dgp"
- cmimetype changed to: "text/plain"
- comment changed to:
Running Tcl without command line arguments but with input not coming from a tty causes .tclshrc (or equivalent) to be loaded. It shouldn't. (We don't want peoples' tclshrc files to cause noninteractive Tcl programs to change their behavior.) How to reproduce: Put something in your .tclshrc like... puts ".tclshrc loaded" echo exit | tclsh8.5 It will emit ".tclshrc loaded". It shouldn't. Note that in the above example, or any other where stdin isn't a tty, tcl_interactive is correctly set to 0. Here is a context diff for a patch that fixes the bug: *** tclMain.c.origThu Nov 3 15:02:54 2011 --- tclMain.cThu Nov 3 15:04:12 2011 *************** *** 460,472 **** } /* ! * We're running interactively. Source a user-specific startup file if the ! * application specified one and if the file exists. */ ! Tcl_SourceRCFile(interp); ! if (Tcl_LimitExceeded(interp)) { ! goto done; } /* --- 460,475 ---- } /* ! * No script file was specified on the command line. ! * If we're running interactively, source a user-specific ! * startup file if the application specified one and if the file exists. */ ! if (tty) { ! Tcl_SourceRCFile(interp); ! if (Tcl_LimitExceeded(interp)) { ! goto done; ! } } /* - foundin changed to: "obsolete: 8.5.10"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "karll"
- subsystem changed to: "38. Init - Library - Autoload"
- title changed to:
Some noninteractive invocations of tclsh still run .tclshrc
- type changed to: "RFE"