aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2018-03-07 19:02:48 +0200
committerTimo Teräs <timo.teras@iki.fi>2018-03-07 19:04:08 +0200
commit2ac0b0bd4ef7da59d284d49fa087fb5447e62b1e (patch)
tree9c4aeeb4b4b0e4df873fbe3a360f65a92f83b09f
parentacd1a5d0d32f4c5029b08bbfa3f6e6c26a472eb8 (diff)
downloadaports-2ac0b0bd4ef7da59d284d49fa087fb5447e62b1e.tar.bz2
aports-2ac0b0bd4ef7da59d284d49fa087fb5447e62b1e.tar.xz
main/musl: cherry-pick upstream nl_langinfo_l fix
Notable this fixes libreoffice to handle utf8 filenames properly.
-rw-r--r--main/musl/0001-fix-getopt-wrongly-treating-colons-in-optstring-as-v.patch30
-rw-r--r--main/musl/0002-fix-nl_langinfo_l-CODESET-loc-reporting-wrong-locale.patch29
-rw-r--r--main/musl/APKBUILD6
3 files changed, 64 insertions, 1 deletions
diff --git a/main/musl/0001-fix-getopt-wrongly-treating-colons-in-optstring-as-v.patch b/main/musl/0001-fix-getopt-wrongly-treating-colons-in-optstring-as-v.patch
new file mode 100644
index 0000000000..f2c949ef6b
--- /dev/null
+++ b/main/musl/0001-fix-getopt-wrongly-treating-colons-in-optstring-as-v.patch
@@ -0,0 +1,30 @@
+From b123f2395266a44176e49cee251fb776e97f26e1 Mon Sep 17 00:00:00 2001
+From: Rich Felker <dalias@aerifal.cx>
+Date: Sat, 24 Feb 2018 10:26:26 -0500
+Subject: [PATCH] fix getopt wrongly treating colons in optstring as valid
+ option chars
+
+the ':' in optstring has special meaning as a flag applying to the
+previous option character, or to getopt's error handling behavior when
+it appears at the beginning. don't also accept a "-:" option based on
+its presence.
+---
+ src/misc/getopt.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/misc/getopt.c b/src/misc/getopt.c
+index e9bab41c..e921a60e 100644
+--- a/src/misc/getopt.c
++++ b/src/misc/getopt.c
+@@ -77,7 +77,7 @@ int getopt(int argc, char * const argv[], const char *optstring)
+ if (l>0) i+=l; else i++;
+ } while (l && d != c);
+
+- if (d != c) {
++ if (d != c || c == ':') {
+ optopt = c;
+ if (optstring[0] != ':' && opterr)
+ __getopt_msg(argv[0], ": unrecognized option: ", optchar, k);
+--
+2.16.2
+
diff --git a/main/musl/0002-fix-nl_langinfo_l-CODESET-loc-reporting-wrong-locale.patch b/main/musl/0002-fix-nl_langinfo_l-CODESET-loc-reporting-wrong-locale.patch
new file mode 100644
index 0000000000..2023daf26a
--- /dev/null
+++ b/main/musl/0002-fix-nl_langinfo_l-CODESET-loc-reporting-wrong-locale.patch
@@ -0,0 +1,29 @@
+From 0cf50581ec5f04feeaa77f2eb8b734a4b69ca8ed Mon Sep 17 00:00:00 2001
+From: Rich Felker <dalias@aerifal.cx>
+Date: Wed, 7 Mar 2018 11:22:38 -0500
+Subject: [PATCH] fix nl_langinfo_l(CODESET, loc) reporting wrong locale's
+ value
+
+use of MB_CUR_MAX encoded a hidden dependency on the currently active
+locale for the calling thread, whereas nl_langinfo_l is supposed to
+report for the locale passed as an argument.
+---
+ src/locale/langinfo.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/locale/langinfo.c b/src/locale/langinfo.c
+index b16caf44..83be6433 100644
+--- a/src/locale/langinfo.c
++++ b/src/locale/langinfo.c
+@@ -33,7 +33,7 @@ char *__nl_langinfo_l(nl_item item, locale_t loc)
+ int idx = item & 65535;
+ const char *str;
+
+- if (item == CODESET) return MB_CUR_MAX==1 ? "ASCII" : "UTF-8";
++ if (item == CODESET) return loc->cat[LC_CTYPE] ? "UTF-8" : "ASCII";
+
+ /* _NL_LOCALE_NAME extension */
+ if (idx == 65535 && cat < LC_ALL)
+--
+2.16.2
+
diff --git a/main/musl/APKBUILD b/main/musl/APKBUILD
index 288b779d31..f6b0034ebe 100644
--- a/main/musl/APKBUILD
+++ b/main/musl/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=musl
pkgver=1.1.19
-pkgrel=0
+pkgrel=1
pkgdesc="the musl c library (libc) implementation"
url="http://www.musl-libc.org/"
arch="all"
@@ -17,6 +17,8 @@ nolibc) ;;
*) subpackages="$subpackages $pkgname-utils";;
esac
source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz
+ 0001-fix-getopt-wrongly-treating-colons-in-optstring-as-v.patch
+ 0002-fix-nl_langinfo_l-CODESET-loc-reporting-wrong-locale.patch
2000-pthread-internals-increase-DEFAULT_GUARD_SIZE-to-2-p.patch
handle-aux-at_base.patch
@@ -143,6 +145,8 @@ compat() {
}
sha512sums="abee52d53af4b3c14c9088866c911a24d2b6ef67dc494f38a7a09dfe77250026f77528c24c52469c89cffa8ced2f0fa95badbdcf8d4460c90faba47e3927bcc5 musl-1.1.19.tar.gz
+7a6480c454ad25d156727818cf61961880e526abcb00382ed81e40256ac5b06af546837652e47187132d64c261d9f01ce91a952762afd439a8faf5825306a880 0001-fix-getopt-wrongly-treating-colons-in-optstring-as-v.patch
+1c649ebd4814ee22364d8766fdf93732e0c0c54361fcfcc994be254b52e9beb276fca5031a1cef9d4f971c96dc3d3774a1738ba3a38263d8e139ea3947c9b7c3 0002-fix-nl_langinfo_l-CODESET-loc-reporting-wrong-locale.patch
2c8e1dde1834238097b2ee8a7bfb53471a0d9cff4a5e38b55f048b567deff1cdd47c170d0578a67b1a039f95a6c5fbb8cff369c75b6a3e4d7ed171e8e86ebb8c 2000-pthread-internals-increase-DEFAULT_GUARD_SIZE-to-2-p.patch
6a7ff16d95b5d1be77e0a0fbb245491817db192176496a57b22ab037637d97a185ea0b0d19da687da66c2a2f5578e4343d230f399d49fe377d8f008410974238 handle-aux-at_base.patch
8d3a2d5315fc56fee7da9abb8b89bb38c6046c33d154c10d168fb35bfde6b0cf9f13042a3bceee34daf091bc409d699223735dcf19f382eeee1f6be34154f26f ldconfig