void-packages/srcpkgs/bird/patches/fix-tests-musl.patch
Đoàn Trần Công Danh c6ce65d3d0 srcpkgs/b*: 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

26 lines
663 B
Diff

--- a/lib/printf_test.c
+++ b/lib/printf_test.c
@@ -22,6 +22,7 @@ static int
t_simple(void)
{
char buf[256];
+ const char *errormsg;
memset(buf, 0xa5, 256);
BSPRINTF(0, "", buf, "", NULL);
@@ -32,11 +33,12 @@ t_simple(void)
BSPRINTF(1, "@", buf, "@", 64);
BSPRINTF(1, "\xff", buf, "%c", 0xff);
- errno = 5;
- BSPRINTF(18, "Input/output error", buf, "%m");
+ errormsg = strerror(EIO);
+ errno = EIO;
+ BSPRINTF(strlen(errormsg), errormsg, buf, "%m");
errno = 0;
- BSPRINTF(18, "Input/output error", buf, "%M", 5);
+ BSPRINTF(strlen(errormsg), errormsg, buf, "%M", EIO);
BSPRINTF(11, "TeSt%StRiNg", buf, "%s", "TeSt%StRiNg");