Avoid segfault on malformed %{!?FOO:} expansion (#9581).

CVS patchset: 3571
CVS date: 2000/02/21 10:32:01
This commit is contained in:
jbj 2000-02-21 10:32:01 +00:00
parent 8feebaf110
commit 7b1e9c5a02
2 changed files with 2 additions and 2 deletions

View File

@ -1116,7 +1116,7 @@ expandMacro(MacroBuf *mb)
if (g && g < ge) { /* Expand X in %{?f:X} */
rc = expandT(mb, g, gn);
} else
if (me->body && *me->body) { /* Expand %{?f}/%{?f*} */
if (me && me->body && *me->body) { /* Expand %{?f}/%{?f*} */
rc = expandT(mb, me->body, strlen(me->body));
}
s = se;

View File

@ -1116,7 +1116,7 @@ expandMacro(MacroBuf *mb)
if (g && g < ge) { /* Expand X in %{?f:X} */
rc = expandT(mb, g, gn);
} else
if (me->body && *me->body) { /* Expand %{?f}/%{?f*} */
if (me && me->body && *me->body) { /* Expand %{?f}/%{?f*} */
rc = expandT(mb, me->body, strlen(me->body));
}
s = se;