diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | URPM.xs | 33 |
2 files changed, 20 insertions, 15 deletions
@@ -1,3 +1,5 @@ +- fix setting rflags on packages (mga#6532) + Version 4.8 - 22 June 2012 - enable to read xz & bzip2 compressed synthesis @@ -1334,19 +1334,6 @@ rpmtag_from_string(char *tag) else croak("unknown tag [%s]", tag); } -static void push_rflags(URPM__Package pkg, int gimme) { - dSP; - if (gimme == G_ARRAY && pkg->rflags != NULL) { - char *s = pkg->rflags; - char *eos; - while ((eos = strchr(s, '\t')) != NULL) { - mXPUSHs(newSVpv(s, eos-s)); - s = eos + 1; - } - mXPUSHs(newSVpv(s, 0)); - } -} - static int compare_evrs(int lepoch, char*lversion, char*lrelease, int repoch, char*rversion, char*rrelease) { int compare; compare = lepoch - repoch; @@ -2281,7 +2268,15 @@ Pkg_rflags(pkg) PREINIT: I32 gimme = GIMME_V; PPCODE: - push_rflags(pkg, gimme); + if (gimme == G_ARRAY && pkg->rflags != NULL) { + char *s = pkg->rflags; + char *eos; + while ((eos = strchr(s, '\t')) != NULL) { + mXPUSHs(newSVpv(s, eos-s)); + s = eos + 1; + } + mXPUSHs(newSVpv(s, 0)); + } void Pkg_set_rflags(pkg, ...) @@ -2307,7 +2302,15 @@ Pkg_set_rflags(pkg, ...) } new_rflags[total_len - 1] = 0; /* but mark end-of-string correctly */ - push_rflags(pkg, gimme); + if (gimme == G_ARRAY && pkg->rflags != NULL) { + char *s = pkg->rflags; + char *eos; + while ((eos = strchr(s, '\t')) != NULL) { + mXPUSHs(newSVpv(s, eos-s)); + s = eos + 1; + } + mXPUSHs(newSVpv(s, 0)); + } free(pkg->rflags); pkg->rflags = new_rflags; |