void-packages/srcpkgs/ckmame/patches/use-mkstemp.patch
Đoàn Trần Công Danh c987560802 srcpkgs/c*: 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

24 lines
484 B
Diff

--- a/src/archive_dir.c 2018-12-18 12:11:40.000000000 +0100
+++ b/src/archive_dir.c 2020-02-27 19:36:16.564802868 +0100
@@ -307,6 +307,7 @@
make_tmp_name(archive_t *a, const char *name) {
size_t i, len;
char *s;
+ int fd;
if (a == NULL || name == NULL) {
errno = EINVAL;
@@ -324,10 +325,12 @@
s[i] = '_';
}
- if (mktemp(s) == NULL) {
+ fd = mkstemp(s);
+ if (fd < 0) {
free(s);
return NULL;
}
+ close(fd);
return s;
}