public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix self-destructing Insight installation!
@ 2004-03-06 23:42 Dave Korn
  0 siblings, 0 replies; only message in thread
From: Dave Korn @ 2004-03-06 23:42 UTC (permalink / raw)
  To: insight; +Cc: cygwin

[-- Attachment #1: Type: text/plain, Size: 1741 bytes --]

> -----Original Message-----
> From: Dave Korn
> Sent: 05 March 2004 18:41
> To: 'insight'

>   And all of a sudden, I got this error message, and insight 
> refused to run.
> 
>   I've only managed to capture it in .PNG format, because it 
> was one of those windows that you can't copy+paste code from, 
> but basically what it said was "Can't find a usable 
> main.tcl", then an error report ("extra characters after 
> close-brace") and stack backtrace, followed by the 
> threatening message "This probably means that insight wasn't 
> installed properly".

  Ok, I've solved it.  It was happening because the name of the function I
set a breakpoint on had the word 'option' in it.  The line in the prefs file
was perfectly valid, but in read_prefs it was being matched by an
insufficiently-tight regexp in the main parse-a-line loop of the function.
This regexp was looking for lines beginning with the word 'option', but the
anchor character was omitted.  The enclosed diff fixes the bug and restores
my insight installation to perfect working order.  (Since the diff is so
tiny, I've attached it as well, in case outlook wraps or mangles it).


2004-03-06  Dave Korn  <dk@artimi.com>

	* prefs.tcl (read_prefs): anchor regexp for option
	command lines at start-of-line.

diff -rNpu insight1.0.orig/prefs.tcl insight1.0/prefs.tcl
--- insight1.0.orig/prefs.tcl	2003-09-20 03:45:17.001000000 +0100
+++ insight1.0/prefs.tcl	2004-03-06 23:23:22.634961900 +0000
@@ -92,7 +92,7 @@ proc pref_read {} {
 	    regexp {\[(.*)\]} $line match section
 	  }
 
-	  {[ \t\n]*option.*} {
+	  {^[ \t\n]*option.*} {
 	    set line [string trimleft $line]
 	    eval $line
 	  }



    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....

[-- Attachment #2: insight-patch.txt --]
[-- Type: text/plain, Size: 400 bytes --]

diff -rNpu insight1.0.orig/prefs.tcl insight1.0/prefs.tcl
--- insight1.0.orig/prefs.tcl	2003-09-20 03:45:17.001000000 +0100
+++ insight1.0/prefs.tcl	2004-03-06 23:23:22.634961900 +0000
@@ -92,7 +92,7 @@ proc pref_read {} {
 	    regexp {\[(.*)\]} $line match section
 	  }
 
-	  {[ \t\n]*option.*} {
+	  {^[ \t\n]*option.*} {
 	    set line [string trimleft $line]
 	    eval $line
 	  }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-03-06 23:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-06 23:42 [PATCH] Fix self-destructing Insight installation! Dave Korn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).