From ddd95c4fe63b2225acd4aef6e0c1be1225359d43 Mon Sep 17 00:00:00 2001 From: "R. Timothy Edwards" Date: Thu, 11 Dec 2025 12:08:31 -0500 Subject: [PATCH] Added a few lines to the setup file parser so that if there is a missing brace in the file (a common error), then the fact that there is an unevaluated command when the file has finished being read will trigger an evaluation of the unfinished code and emit an error. Previously, the command and anything after the unterminated brace would just silently get ignored, which was not helpful for debugging setup syntax errors. --- VERSION | 2 +- tcltk/netgen.tcl.in | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index fdd8146..e903888 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.312 +1.5.313 diff --git a/tcltk/netgen.tcl.in b/tcltk/netgen.tcl.in index 7bdf978..994febf 100644 --- a/tcltk/netgen.tcl.in +++ b/tcltk/netgen.tcl.in @@ -516,6 +516,14 @@ proc netgen::lvs { name1 name2 {setupfile setup.tcl} {logfile comp.out} args} { } } close $fsetup + if {$command != {}} { + # Incomplete command. Evaluate it to get a meaningful error message + if {[catch {uplevel 1 [list namespace eval netgen $command]} msg]} { + set msg [string trimright $msg "\n"] + puts stderr "Error $setupfile:$sline (ignoring), $msg" + incr perrors + } + } } else { puts stdout "Error: Cannot read the setup file $setupfile" }