This is the mail archive of the
insight@sourceware.org
mailing list for the Insight project.
[PATCH] Save preferences correctly
- From: Andrew STUBBS <andrew dot stubbs at st dot com>
- To: insight at sourceware dot org
- Date: Thu, 07 Sep 2006 17:44:09 +0100
- Subject: [PATCH] Save preferences correctly
Hi,
Last year I contributed a patch to make Insight read the .gdbtkinit file
when the INSIGHT_FORCE_READ_PREFERENCES environment variable is set,
regardless of -nx.
Unfortunately, I forgot to check the same variable when saving the
preferences. The attached patch should remedy the omission.
Andrew Stubbs
2006-09-07 Andrew Stubbs <andrew.stubbs@st.com>
* library/prefs.tcl (pref_save): Save preferences if
INSIGHT_FORCE_READ_PREFERENCES is set in the environment.
Index: gdb/gdbtk/library/prefs.tcl
===================================================================
--- gdb/gdbtk/library/prefs.tcl.orig 2006-09-07 17:30:19.000000000 +0100
+++ gdb/gdbtk/library/prefs.tcl 2006-09-07 17:35:10.000000000 +0100
@@ -160,9 +160,10 @@ proc pref_read {} {
# PROC: pref_save - save preferences to a file and delete window
# ------------------------------------------------------------------
proc pref_save {{win {}}} {
- global prefs_init_filename GDBStartup
+ global prefs_init_filename GDBStartup env
- if {!$GDBStartup(inhibit_prefs)} {
+ if {!$GDBStartup(inhibit_prefs)
+ || [info exists env(INSIGHT_FORCE_READ_PREFERENCES)]} {
debug "pref_save $prefs_init_filename"
if {[catch {open $prefs_init_filename w} fd]} {