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".
This commit is contained in:
Tim Edwards 2024-04-10 20:51:05 -04:00
parent 60049f3702
commit 82d64aa4b1
2 changed files with 5 additions and 2 deletions

View File

@ -1 +1 @@
8.3.471
8.3.472

View File

@ -226,7 +226,10 @@ for {set i 0} {$i < $argc} {incr i 1} {
if {$do_wrapper} {
source ${CAD_ROOT}/magic/tcl/wrapper.tcl
lappend argafter "-nowindow" ;# Set no-initial-window option in magic.
# Set the no-initial-window option in magic. Do *not* append it, as the
# arguments may have a Tcl script, for which all following arguments are
# considered arguments of the script.
set argafter [linsert $argafter 1 -nowindow]
}
unset x i do_wrapper
if {[catch {eval $argafter}]} { ;# magic::initialize ${argv}