diff options
Diffstat (limited to 'URPM.xs')
-rw-r--r-- | URPM.xs | 33 |
1 files changed, 18 insertions, 15 deletions
@@ -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; |