1 --- rpm-4.5/rpmio/macro.c.org 2009-08-08 15:42:25.574860247 +0200
2 +++ rpm-4.5/rpmio/macro.c 2009-08-08 15:47:20.495455961 +0200
7 +void delMacroAll(MacroContext mc, const char * n);
10 + * Parse (and execute) macro undefinition.
11 + * @param mc macro context
12 + * @param se macro name to undefine
13 + * @return address to continue parsing
15 +/*@dependent@*/ static const char *
16 +doUnglobal(MacroContext mc, /*@returned@*/ const char * se)
17 + /*@globals rpmGlobalMacroContext @*/
18 + /*@modifies mc, rpmGlobalMacroContext @*/
21 + char *buf = alloca(_macro_BUFSIZ);
22 + char *n = buf, *ne = n;
27 + /* Move scan over body */
32 + /* Names must start with alphabetic or _ and be at least 3 chars */
33 + if (!((c = *n) && (xisalpha(c) || c == '_') && (ne - n) > 2)) {
35 + _("Macro %%%s has illegal name (%%unglobal)\n"), n);
46 dumpME(const char * msg, MacroEntry me)
47 @@ -1430,6 +1465,10 @@
48 s = doUndefine(mb->mc, se);
51 + if (STREQ("unglobal", f, fn)) {
52 + s = doUnglobal(mb->mc, se);
56 if (STREQ("echo", f, fn) ||
57 STREQ("warn", f, fn) ||
58 @@ -1984,6 +2023,18 @@
63 +delMacroAll(MacroContext mc, const char * n)
67 + if (mc == NULL) mc = rpmGlobalMacroContext;
68 + /* If name exists, pop entry */
69 + while ((mep = findEntry(mc, n, 0)) != NULL) {
74 /*@-mustmod@*/ /* LCL: mc is modified through mb->mc, mb is abstract */
76 rpmDefineMacro(MacroContext mc, const char * macro, int level)