c987560802
```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 ```
24 lines
484 B
Diff
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;
|
|
}
|
|
|