diff options
author | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2011-07-04 13:21:34 +0000 |
---|---|---|
committer | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2011-07-04 13:21:34 +0000 |
commit | 636943c5f6fbd70b5ad1f3b1736364cfbc30ae19 (patch) | |
tree | 0b5adf71db61f008463ae89738b9f4ede5234a40 | |
parent | 27d8a748a7d2e62cb713e14067fbb8f24233b90a (diff) | |
download | perl-URPM-636943c5f6fbd70b5ad1f3b1736364cfbc30ae19.tar perl-URPM-636943c5f6fbd70b5ad1f3b1736364cfbc30ae19.tar.gz perl-URPM-636943c5f6fbd70b5ad1f3b1736364cfbc30ae19.tar.bz2 perl-URPM-636943c5f6fbd70b5ad1f3b1736364cfbc30ae19.tar.xz perl-URPM-636943c5f6fbd70b5ad1f3b1736364cfbc30ae19.zip |
fix pretend_distepoch() with release ending with '9'
-rw-r--r-- | URPM.xs | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -273,9 +273,13 @@ pretend_distepoch(Header header, int32_t names_tag, int32_t flags_tag, int32_t v name2[names.count-1] = name[flags.ix]; flag2[names.count-1] = (flag[flags.ix] | RPMSENSE_LESS) & ~RPMSENSE_EQUAL; flag2[flags.ix] |= RPMSENSE_GREATER; - version2[names.count-1] = strdup(version[flags.ix]); - char *v = version2[names.count-1]; - (*(&v[strlen(v)-1]))++; + version2[names.count-1] = calloc(strlen(version[flags.ix])+2, 1); + char *v = stpcpy(version2[names.count-1], version[flags.ix]); + if (v[-1] == '9') { + v[-1] = '1'; + v[0] = '0'; + } else + (*(&v[-1]))++; } } if(name) { |