diff options
author | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2010-12-23 13:44:37 +0000 |
---|---|---|
committer | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2010-12-23 13:44:37 +0000 |
commit | ecf169cda8a941162c4797da967e0d4ee8e68a2a (patch) | |
tree | 8a0cd9713710f565bf4ff5e98fcedc1948d40c66 | |
parent | 949d919e1a6eb7df75e9b76adee315e73462e131 (diff) | |
download | perl-URPM-ecf169cda8a941162c4797da967e0d4ee8e68a2a.tar perl-URPM-ecf169cda8a941162c4797da967e0d4ee8e68a2a.tar.gz perl-URPM-ecf169cda8a941162c4797da967e0d4ee8e68a2a.tar.bz2 perl-URPM-ecf169cda8a941162c4797da967e0d4ee8e68a2a.tar.xz perl-URPM-ecf169cda8a941162c4797da967e0d4ee8e68a2a.zip |
fix code expecting get_fullname_parts_info() not to return void
-rw-r--r-- | URPM.xs | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -783,48 +783,47 @@ return_list_tag(URPM__Package pkg, const char *tag_name) { switch (tag) { case RPMTAG_NAME: { - if(get_fullname_parts_info(pkg, &name, &epoch, &version, &release, &arch, &disttag, &distepoch, &eos)) + get_fullname_parts_info(pkg, &name, &epoch, &version, &release, &arch, &disttag, &distepoch, &eos); + if(!strlen(name)) croak("invalid fullname"); XPUSHs(sv_2mortal(newSVpv(name, 0))); } break; case RPMTAG_EPOCH: { - if(get_fullname_parts_info(pkg, &name, &epoch, &version, &release, &arch, &disttag, &distepoch, &eos)) - croak("invalid fullname"); + get_fullname_parts_info(pkg, &name, &epoch, &version, &release, &arch, &disttag, &distepoch, &eos); XPUSHs(sv_2mortal(newSViv(epoch))); } case RPMTAG_VERSION: { - if(get_fullname_parts_info(pkg, &name, &epoch, &version, &release, &arch, &disttag, &distepoch, &eos)) + get_fullname_parts_info(pkg, &name, &epoch, &version, &release, &arch, &disttag, &distepoch, &eos); + if(!strlen(version)) croak("invalid fullname"); XPUSHs(sv_2mortal(newSVpv(version, 0))); } break; case RPMTAG_RELEASE: { - if(get_fullname_parts_info(pkg, &name, &epoch, &version, &release, &arch, &disttag, &distepoch, &eos)) + get_fullname_parts_info(pkg, &name, &epoch, &version, &release, &arch, &disttag, &distepoch, &eos); + if(!strlen(release)) croak("invalid fullname"); XPUSHs(sv_2mortal(newSVpv(release, 0))); } break; case RPMTAG_DISTTAG: { - if(get_fullname_parts_info(pkg, &name, &epoch, &version, &release, &arch, &disttag, &distepoch, &eos)) - croak("invalid fullname"); + get_fullname_parts_info(pkg, &name, &epoch, &version, &release, &arch, &disttag, &distepoch, &eos); XPUSHs(sv_2mortal(newSVpv(disttag, 0))); } break; case RPMTAG_DISTEPOCH: { - if(get_fullname_parts_info(pkg, &name, &epoch, &version, &release, &arch, &disttag, &distepoch, &eos)) - croak("invalid fullname"); + get_fullname_parts_info(pkg, &name, &epoch, &version, &release, &arch, &disttag, &distepoch, &eos); XPUSHs(sv_2mortal(newSVpv(distepoch, 0))); } break; case RPMTAG_ARCH: { - if(get_fullname_parts_info(pkg, &name, &epoch, &version, &release, &arch, &disttag, &distepoch, &eos)) - croak("invalid fullname"); + get_fullname_parts_info(pkg, &name, &epoch, &version, &release, &arch, &disttag, &distepoch, &eos); XPUSHs(sv_2mortal(newSVpv(arch, 0))); } break; |