void-packages/srcpkgs/mon/patches/fix-long_long.patch
Đoàn Trần Công Danh 765e304c4b srcpkgs/m*: 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

22 lines
521 B
Diff

Size of long may be 32-bit and thus can't hold MS_YEAR.
--- a/deps/ms.c 2013-12-01 18:34:08.000000000 +0100
+++ b/deps/ms.c 2015-09-09 22:47:16.476393763 +0200
@@ -91,7 +91,7 @@
milliseconds_to_string(long long ms) {
char *str = malloc(MS_MAX);
if (!str) return NULL;
- long div = 1;
+ long long div = 1;
char *fmt;
if (ms < MS_SEC) fmt = "%lldms";
@@ -113,7 +113,7 @@
char *
milliseconds_to_long_string(long long ms) {
- long div;
+ long long div;
char *name;
char *str = malloc(MS_MAX);