From 7f5a4a4aed21b30717605d6e1d7829661476af81 Mon Sep 17 00:00:00 2001 From: jbj Date: Thu, 24 Jun 1999 22:23:46 +0000 Subject: [PATCH] fix: bsearch needs macro table sorted after undefine. CVS patchset: 3109 CVS date: 1999/06/24 22:23:46 --- CHANGES | 1 + lib/macro.c | 8 ++++++-- po/rpm.pot | 2 +- rpm.spec | 2 +- rpmio/macro.c | 8 ++++++-- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index cd0b8a6..a58af52 100644 --- a/CHANGES +++ b/CHANGES @@ -17,6 +17,7 @@ - MiNT port (Guido Flohr ). - fix: --rebuilddb with --root dinna remove directory (Michael Andres). - fix: false fingerprint stat cache hit -- "the tetex problem" (#2727). + - fix: bsearch needs macro table sorted after undefine. 3.0 -> 3.0.1 - fix: %verifyscript resurrected (Shing-Gene Yung). diff --git a/lib/macro.c b/lib/macro.c index 5d1a71a..ff2f40d 100644 --- a/lib/macro.c +++ b/lib/macro.c @@ -1162,13 +1162,17 @@ addMacro(MacroContext *mc, const char *n, const char *o, const char *b, int leve void delMacro(MacroContext *mc, const char *name) { - MacroEntry **mep = findEntry(mc, name, 0); + MacroEntry **mep; if (mc == NULL) mc = &globalMacroContext; /* If name exists, pop entry */ - if ((mep = findEntry(mc, name, 0)) != NULL) + if ((mep = findEntry(mc, name, 0)) != NULL) { popMacro(mep); + /* If deleted name, sort macro table */ + if (!(mep && *mep)) + sortMacroTable(mc); + } } int diff --git a/po/rpm.pot b/po/rpm.pot index 0aaea20..3a3d32b 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 1999-06-23 16:54-0400\n" +"POT-Creation-Date: 1999-06-24 17:12-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/rpm.spec b/rpm.spec index 7a99271..4a85f3a 100644 --- a/rpm.spec +++ b/rpm.spec @@ -2,7 +2,7 @@ Summary: The Red Hat package management system. Name: rpm %define version 3.0.2 Version: %{version} -Release: 0.7 +Release: 0.8 Group: System Environment/Base Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-3.0.x/rpm-%{version}.tar.gz Copyright: GPL diff --git a/rpmio/macro.c b/rpmio/macro.c index 5d1a71a..ff2f40d 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -1162,13 +1162,17 @@ addMacro(MacroContext *mc, const char *n, const char *o, const char *b, int leve void delMacro(MacroContext *mc, const char *name) { - MacroEntry **mep = findEntry(mc, name, 0); + MacroEntry **mep; if (mc == NULL) mc = &globalMacroContext; /* If name exists, pop entry */ - if ((mep = findEntry(mc, name, 0)) != NULL) + if ((mep = findEntry(mc, name, 0)) != NULL) { popMacro(mep); + /* If deleted name, sort macro table */ + if (!(mep && *mep)) + sortMacroTable(mc); + } } int -- 2.7.4