diff options
Diffstat (limited to 'community/pdfgrep/no-locale.patch')
-rw-r--r-- | community/pdfgrep/no-locale.patch | 31 |
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 @@ | |||
1 | Don't set locale explicitly. musl supports UTF-8 by default. | ||
2 | |||
3 | With this change pdfgrep fails with: | ||
4 | |||
5 | terminate called after throwing an instance of 'std::runtime_error' | ||
6 | what(): locale::facet::_S_create_c_locale name not valid | ||
7 | Aborted | ||
8 | |||
9 | Unless LANG is set explicitly. | ||
10 | |||
11 | Alternative solutions: | ||
12 | |||
13 | * Use the "C" lang instead of the "" lang? | ||
14 | * Catch the error and ignore it? | ||
15 | |||
16 | diff -upr pdfgrep-2.1.2.orig/src/pdfgrep.cc pdfgrep-2.1.2/src/pdfgrep.cc | ||
17 | --- pdfgrep-2.1.2.orig/src/pdfgrep.cc 2020-09-29 12:33:50.018014326 +0200 | ||
18 | +++ pdfgrep-2.1.2/src/pdfgrep.cc 2020-09-29 12:36:39.827698175 +0200 | ||
19 | @@ -457,10 +457,12 @@ int main(int argc, char** argv) | ||
20 | Options options; | ||
21 | init_colors(options.outconf.colors); | ||
22 | |||
23 | +#if 0 | ||
24 | // Set locale to user-preference. If this locale is an UTF-8 locale, the | ||
25 | // regex-functions regcomp/regexec become unicode aware, which means | ||
26 | // e.g. that '.' will match a unicode character, not a single byte. | ||
27 | locale::global(locale("")); | ||
28 | +#endif | ||
29 | |||
30 | enum re_engine_type { | ||
31 | RE_POSIX = 0, | ||