aboutsummaryrefslogtreecommitdiffstats
path: root/community/pdfgrep/no-locale.patch
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2020-09-29 20:46:08 +0200
committerLeo <thinkabit.ukim@gmail.com>2020-10-11 21:09:19 -0300
commit4eb48259ea47067f52772e7cbf3d7345c3bf988c (patch)
tree5aa90b00d95121f4e41c367b0796f4372fcb551e /community/pdfgrep/no-locale.patch
parent4e99e3e57672dc19dd735273ca4bee6b31f9f705 (diff)
downloadaports-4eb48259ea47067f52772e7cbf3d7345c3bf988c.tar.gz
aports-4eb48259ea47067f52772e7cbf3d7345c3bf988c.tar.bz2
aports-4eb48259ea47067f52772e7cbf3d7345c3bf988c.tar.xz
community/pdfgrep: prevent crash if LANG is not set explicitly
Diffstat (limited to 'community/pdfgrep/no-locale.patch')
-rw-r--r--community/pdfgrep/no-locale.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/community/pdfgrep/no-locale.patch b/community/pdfgrep/no-locale.patch
new file mode 100644
index 0000000000..d450055abe
--- /dev/null
+++ b/community/pdfgrep/no-locale.patch
@@ -0,0 +1,31 @@
+Don't set locale explicitly. musl supports UTF-8 by default.
+
+With this change pdfgrep fails with:
+
+ terminate called after throwing an instance of 'std::runtime_error'
+ what(): locale::facet::_S_create_c_locale name not valid
+ Aborted
+
+Unless LANG is set explicitly.
+
+Alternative solutions:
+
+ * Use the "C" lang instead of the "" lang?
+ * Catch the error and ignore it?
+
+diff -upr pdfgrep-2.1.2.orig/src/pdfgrep.cc pdfgrep-2.1.2/src/pdfgrep.cc
+--- pdfgrep-2.1.2.orig/src/pdfgrep.cc 2020-09-29 12:33:50.018014326 +0200
++++ pdfgrep-2.1.2/src/pdfgrep.cc 2020-09-29 12:36:39.827698175 +0200
+@@ -457,10 +457,12 @@ int main(int argc, char** argv)
+ Options options;
+ init_colors(options.outconf.colors);
+
++#if 0
+ // Set locale to user-preference. If this locale is an UTF-8 locale, the
+ // regex-functions regcomp/regexec become unicode aware, which means
+ // e.g. that '.' will match a unicode character, not a single byte.
+ locale::global(locale(""));
++#endif
+
+ enum re_engine_type {
+ RE_POSIX = 0,