From e60a522ad7f529f124302d7163ac1284a74bc63a Mon Sep 17 00:00:00 2001
From: dprice <dprice@users.savannah.nongnu.org>
Date: Sat, 29 Aug 2009 18:18:01 +0000
Subject: [PATCH] * parseinfo.c (new_config): Initialize new property.
 (parse_config): Store existence of user-specified LogHistory directive per
 config file rather than globally. * parseinfo.h (struct config): Add new
 usingDefaultLogHistory boolean.

---
 src/ChangeLog   | 7 +++++++
 src/parseinfo.c | 8 ++++----
 src/parseinfo.h | 3 +++
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index dd2e2cc14..0d48864b9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2009-08-29  Derek R. Price  <derek@ximbiot.com>
+
+	* parseinfo.c (new_config): Initialize new property.
+	(parse_config): Store existence of user-specified LogHistory directive
+	per config file rather than globally.
+	* parseinfo.h (struct config): Add new usingDefaultLogHistory boolean.
+
 2009-08-03  Derek R. Price  <derek@ximbiot.com>
 
 	* parseinfo.c (parse_config): Find alternate config files correctly.
diff --git a/src/parseinfo.c b/src/parseinfo.c
index 6743b939d..4631f46b9 100644
--- a/src/parseinfo.c
+++ b/src/parseinfo.c
@@ -316,6 +316,7 @@ new_config (void)
     TRACE (TRACE_FLOW, "new_config ()");
 
     new->logHistory = xstrdup (ALL_HISTORY_REC_TYPES);
+    new->usingDefaultLogHistory = true;
     new->RereadLogAfterVerify = LOGMSG_REREAD_ALWAYS;
     new->FirstVerifyLogErrorFatal = true;
     new->UserAdminOptions = xstrdup ("k");
@@ -677,13 +678,12 @@ parse_config (const char *cvsroot, const char *path)
 	{
 	    if (!STREQ (p, "all"))
 	    {
-		static bool gotone = false;
-		if (gotone)
+		if (retval->usingDefaultLogHistory)
+		    retval->usingDefaultLogHistory = false;
+		else
 		    error (0, 0, "\
 %s [%u]: warning: duplicate LogHistory entry found.",
 			   infopath, ln);
-		else
-		    gotone = true;
 		free (retval->logHistory);
 		retval->logHistory = xstrdup (p);
 	    }
diff --git a/src/parseinfo.h b/src/parseinfo.h
index d3ef9d267..04fdd6441 100644
--- a/src/parseinfo.h
+++ b/src/parseinfo.h
@@ -27,7 +27,10 @@ struct config
     void *keywords;
     bool top_level_admin;
     char *lock_dir;
+
     char *logHistory;
+    bool usingDefaultLogHistory;
+
     char *HistoryLogPath;
     char *HistorySearchPath;
     char *TmpDir;
-- 
GitLab