summaryrefslogtreecommitdiff
path: root/lib/macro.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/macro.c')
-rw-r--r--lib/macro.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/macro.c b/lib/macro.c
index 5d1a71a15..ff2f40d3c 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