void-packages/srcpkgs/php/patches/php-706-crypt.patch
Đoàn Trần Công Danh 49cb564d14 srcpkgs/p*: 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

16 lines
439 B
Diff

--- a/ext/standard/crypt.c 2016-04-28 14:13:00.000000000 -0400
+++ b/ext/standard/crypt.c 2016-04-28 21:45:24.340955313 -0400
@@ -267,6 +267,12 @@
}
# elif defined(HAVE_CRYPT)
crypt_res = crypt(password, salt);
+ if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) {
+ return NULL;
+ } else {
+ result = zend_string_init(crypt_res, strlen(crypt_res), 0);
+ return result;
+ }
# else
# error No crypt() implementation
# endif