void-packages/srcpkgs/zsnes/patches/patch-zip_zpng.c.diff
Đoàn Trần Công Danh e2a21ccfd6 srcpkgs/z*: 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

14 lines
652 B
Diff

$NetBSD: patch-zip_zpng.c,v 1.1 2011/03/15 11:46:09 obache Exp $
* direct access is not allowed with png-1.5, but already set color_type.
--- a/src/zip/zpng.c 2007-01-15 23:06:29.000000000 +0000
+++ b/src/zip/zpng.c
@@ -129,7 +129,6 @@ int Png_Dump(const char *filename, unsig
png_set_IHDR(png_ptr, info_ptr, width, height, 8,
PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,
PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
- info_ptr->color_type = PNG_COLOR_TYPE_RGB;
//Allocate an array of scanline pointers
row_pointers = (png_bytep*)malloc(height*sizeof(png_bytep));