void-packages/srcpkgs/quota/patches/reallocarray.patch
Đoàn Trần Công Danh 635e9da391 srcpkgs/q*: 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

29 lines
787 B
Diff

Index: configure.ac
===================================================================
--- a/configure.ac
+++ b/configure.ac
@@ -38,6 +38,9 @@ AC_C_INLINE
AC_CHECK_FUNC([nl_langinfo], [
AC_DEFINE([HAVE_NL_LANGINFO], 1, [Use nl_langinfo for querying locale])
])
+AC_CHECK_DECLS([reallocarray],[
+ AC_DEFINE([HAVE_REALLOCARRAY], 1, [Have reallocarray])
+])
# ===============
# Gettext support
Index: quota.c
===================================================================
--- a/quota.c
+++ b/quota.c
@@ -48,6 +48,10 @@
#define FL_SHOW_DEVICE 32768
#define FL_PROJECT 65536
+#ifndef HAVE_REALLOCARRAY
+#define reallocarray(o,n,s) realloc(o,n*s)
+#endif
+
static int flags, fmt = -1;
static enum s2s_unit spaceunit = S2S_NONE, inodeunit = S2S_NONE;
char *progname;