RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: j...@rpm5.org Module: rpm Date: 18-Sep-2014 04:58:23 Branch: rpm-5_4 Handle: 2014091802582200 Modified files: (Branch: rpm-5_4) rpm/rpmio macro.c Log: - macro: fix: handle %{foo:bar ...} correctly. Summary: Revision Changes Path 2.249.2.20 +5 -1 rpm/rpmio/macro.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/rpmio/macro.c ============================================================================ $ cvs diff -u -r2.249.2.19 -r2.249.2.20 macro.c --- rpm/rpmio/macro.c 18 Sep 2014 00:01:12 -0000 2.249.2.19 +++ rpm/rpmio/macro.c 18 Sep 2014 02:58:22 -0000 2.249.2.20 @@ -1617,11 +1617,14 @@ { char * script = NULL; const char * se; + int gotwhitespace = 0; /* XXX FIXME: args might have embedded : too. */ for (se = s + 1; se < (s+nb); se++) switch (*se) { - default: continue; break; + default: + if (strchr(" \f\n\r\t\v", *se)) gotwhitespace = 1; + continue; break; case '\\': if (se[1] == '\0') break; se++; continue; break; case '\'': se = matchchar(se+1, *se, '\''); assert(se); continue; break; case '\"': se = matchchar(se+1, *se, '\"'); assert(se); continue; break; @@ -1629,6 +1632,7 @@ case '{': se = matchchar(se+1, *se, '}'); assert(se); continue; break; case '(': se = matchchar(se+1, *se, ')'); assert(se); continue; break; case ':': + if (!gotwhitespace) goto bingo; if (!strchr("%", se[ 1])) continue; /* XXX date format */ if (!strchr("V", se[-1])) continue; /* XXX perl -V:.* */ goto bingo; break; @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org