diff options
author | Piraty <mail@piraty.dev> | 2023-07-27 21:36:24 +0000 |
---|---|---|
committer | Piraty <mail@piraty.dev> | 2023-08-30 13:35:47 +0000 |
commit | 323eea7c382edb27a7792fdbb760fba1de107b8e (patch) | |
tree | 595233bea6b11a63a6434d4163500b16b0a96583 | |
parent | 6d0ec2727308eeb526b6d2d2c43a5c96de47ac3a (diff) | |
download | void-packages-323eea7c382edb27a7792fdbb760fba1de107b8e.tar void-packages-323eea7c382edb27a7792fdbb760fba1de107b8e.tar.gz void-packages-323eea7c382edb27a7792fdbb760fba1de107b8e.tar.bz2 void-packages-323eea7c382edb27a7792fdbb760fba1de107b8e.tar.lz void-packages-323eea7c382edb27a7792fdbb760fba1de107b8e.tar.xz void-packages-323eea7c382edb27a7792fdbb760fba1de107b8e.tar.zst void-packages-323eea7c382edb27a7792fdbb760fba1de107b8e.zip |
musl: backport patch to fix strverscmp
it's part of 1.2.4 upstream
-rw-r--r-- | srcpkgs/musl/patches/fix-strverscmp-comparison-of-digit-sequence-with-non.patch.patch | 38 | ||||
-rw-r--r-- | srcpkgs/musl/template | 2 |
2 files changed, 39 insertions, 1 deletions
diff --git a/srcpkgs/musl/patches/fix-strverscmp-comparison-of-digit-sequence-with-non.patch.patch b/srcpkgs/musl/patches/fix-strverscmp-comparison-of-digit-sequence-with-non.patch.patch new file mode 100644 index 00000000000..e0f0b8bffff --- /dev/null +++ b/srcpkgs/musl/patches/fix-strverscmp-comparison-of-digit-sequence-with-non.patch.patch @@ -0,0 +1,38 @@ +From b50eb8c36c20f967bd0ed70c0b0db38a450886ba Mon Sep 17 00:00:00 2001 +From: Rich Felker <dalias@aerifal.cx> +Date: Mon, 7 Nov 2022 22:17:55 -0500 +Subject: [PATCH] fix strverscmp comparison of digit sequence with non-digits + +the rule that longest digit sequence not beginning with a zero is +greater only applies when both sequences being compared are +non-degenerate. this is spelled out explicitly in the man page, which +may be deemed authoritative for this nonstandard function: "If one or +both of these is empty, then return what strcmp(3) would have +returned..." + +we were wrongly treating any sequence of digits not beginning with a +zero as greater than a non-digit in the other string. +--- + src/string/strverscmp.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/string/strverscmp.c b/src/string/strverscmp.c +index 4daf276d..16c1da22 100644 +--- a/src/string/strverscmp.c ++++ b/src/string/strverscmp.c +@@ -18,9 +18,9 @@ int strverscmp(const char *l0, const char *r0) + else if (c!='0') z=0; + } + +- if (l[dp]!='0' && r[dp]!='0') { +- /* If we're not looking at a digit sequence that began +- * with a zero, longest digit string is greater. */ ++ if (l[dp]-'1'<9U && r[dp]-'1'<9U) { ++ /* If we're looking at non-degenerate digit sequences starting ++ * with nonzero digits, longest digit string is greater. */ + for (j=i; isdigit(l[j]); j++) + if (!isdigit(r[j])) return 1; + if (isdigit(r[j])) return -1; +-- +2.41.0 + diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template index e0e05c2df09..6c98fac0962 100644 --- a/srcpkgs/musl/template +++ b/srcpkgs/musl/template @@ -2,7 +2,7 @@ pkgname=musl reverts="1.2.0_1" version=1.1.24 -revision=17 +revision=18 archs="*-musl" bootstrap=yes build_style=gnu-configure |