summaryrefslogtreecommitdiff
path: root/rpmio
diff options
context:
space:
mode:
authorjbj <devnull@localhost>1999-06-24 22:23:46 +0000
committerjbj <devnull@localhost>1999-06-24 22:23:46 +0000
commit7f5a4a4aed21b30717605d6e1d7829661476af81 (patch)
tree813c7dc3a24132990249dcaea046d4ef3716ea89 /rpmio
parent8bc8f024e61fc218fe8285e33e645a2bb8df7ed6 (diff)
downloadlibrpm-tizen-7f5a4a4aed21b30717605d6e1d7829661476af81.tar.gz
librpm-tizen-7f5a4a4aed21b30717605d6e1d7829661476af81.tar.bz2
librpm-tizen-7f5a4a4aed21b30717605d6e1d7829661476af81.zip
fix: bsearch needs macro table sorted after undefine.
CVS patchset: 3109 CVS date: 1999/06/24 22:23:46
Diffstat (limited to 'rpmio')
-rw-r--r--rpmio/macro.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/rpmio/macro.c b/rpmio/macro.c
index 5d1a71a15..ff2f40d3c 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