aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2011-07-04 13:21:20 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2011-07-04 13:21:20 +0000
commit87bd0ddadc671760b5192848f44474c71ff9f2cd (patch)
treea7f7f3376977aab40330129c8f85c5f5b6355976
parent10f2dfe084fb9a7ba4446fa2336646638d40d9b1 (diff)
downloadperl-URPM-87bd0ddadc671760b5192848f44474c71ff9f2cd.tar
perl-URPM-87bd0ddadc671760b5192848f44474c71ff9f2cd.tar.gz
perl-URPM-87bd0ddadc671760b5192848f44474c71ff9f2cd.tar.bz2
perl-URPM-87bd0ddadc671760b5192848f44474c71ff9f2cd.tar.xz
perl-URPM-87bd0ddadc671760b5192848f44474c71ff9f2cd.zip
fix pretend_distepoch() with release ending with '9'
-rw-r--r--URPM.xs10
1 files changed, 7 insertions, 3 deletions
diff --git a/URPM.xs b/URPM.xs
index 1b11530..0e34dd5 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -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) {