void-packages/srcpkgs/okular/patches/musl-vasprintf.patch
Đoàn Trần Công Danh 2fd8d4df94 srcpkgs/o*: convert patches to -Np1
```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

29 lines
645 B
Diff

--- a/core/synctex/synctex_parser.c 2017-12-05 23:07:10.000000000 +0100
+++ b/core/synctex/synctex_parser.c 2018-01-01 19:03:46.281593488 +0100
@@ -8188,6 +8188,26 @@
}
#endif
+#if !defined(__GLIBC__)
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+static int vasprintf(char **ret,
+ const char *format,
+ va_list ap)
+{
+ int len;
+ len = vsnprintf(NULL, 0, format, ap);
+ if (len < 0) return -1;
+ *ret = malloc(len + 1);
+ if (!*ret) return -1;
+ vsnprintf(*ret, len+1, format, ap);
+ (*ret)[len] = '\0';
+ return len;
+}
+
+#endif
/**
* gzvprintf is not available until OSX 10.10