void-packages/srcpkgs/pdfgrep/patches/fix-musl.patch
Đoàn Trần Công Danh 49cb564d14 srcpkgs/p*: convert patches to -Np1
* par is kept at -Np0

```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

14 lines
527 B
Diff

diff --git a/src/pdfgrep.cc b/src/pdfgrep.cc
index 7f8bdf8..5283e16 100644
--- a/src/pdfgrep.cc
+++ b/src/pdfgrep.cc
@@ -460,7 +460,9 @@ int main(int argc, char** argv)
// 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.
+#ifdef __GLIBC__
locale::global(locale(""));
+#endif
enum re_engine_type {
RE_POSIX = 0,