Skip to content

Commit 82d64aa

Browse files
Corrected an issue with passing a Tcl script as a command-line
argument. For interactive magic in the Tcl/Tk wrapper, the "-nowindow" option was appended to the command line. But for Tcl scripts on the command line, all arguments following the script name are considered arguments of the script. So the "-nowindow" argument has to be inserted at the beginning of the command line as the first argument after "magic".
1 parent 60049f3 commit 82d64aa

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.3.471
1+
8.3.472

tcltk/magic.tcl.in

+4-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,10 @@ for {set i 0} {$i < $argc} {incr i 1} {
226226

227227
if {$do_wrapper} {
228228
source ${CAD_ROOT}/magic/tcl/wrapper.tcl
229-
lappend argafter "-nowindow" ;# Set no-initial-window option in magic.
229+
# Set the no-initial-window option in magic. Do *not* append it, as the
230+
# arguments may have a Tcl script, for which all following arguments are
231+
# considered arguments of the script.
232+
set argafter [linsert $argafter 1 -nowindow]
230233
}
231234
unset x i do_wrapper
232235
if {[catch {eval $argafter}]} { ;# magic::initialize ${argv}

0 commit comments

Comments
 (0)