void-packages/srcpkgs/bc/patches/read.patch
Đoàn Trần Công Danh c6ce65d3d0 srcpkgs/b*: 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

44 lines
1.4 KiB
Diff

--- a/bc/execute.c
+++ b/bc/execute.c
@@ -638,19 +638,19 @@ push_constant (int (*in_char)(VOID), int conv_base)
}
/* Check for the special case of a single digit. */
- if (in_ch < 36)
+ if (in_ch < 16)
{
first_ch = in_ch;
in_ch = in_char();
- if (in_ch < 36 && first_ch >= conv_base)
+ if (in_ch < 16 && first_ch >= conv_base)
first_ch = conv_base - 1;
bc_int2num (&build, (int) first_ch);
}
/* Convert the integer part. */
- while (in_ch < 36)
+ while (in_ch < 16)
{
- if (in_ch < 36 && in_ch >= conv_base) in_ch = conv_base-1;
+ if (in_ch < 16 && in_ch >= conv_base) in_ch = conv_base-1;
bc_multiply (build, mult, &result, 0);
bc_int2num (&temp, (int) in_ch);
bc_add (result, temp, &build, 0);
@@ -665,7 +665,7 @@ push_constant (int (*in_char)(VOID), int conv_base)
divisor = bc_copy_num (_one_);
result = bc_copy_num (_zero_);
digits = 0;
- while (in_ch < 36)
+ while (in_ch < 16)
{
bc_multiply (result, mult, &result, 0);
bc_int2num (&temp, (int) in_ch);
@@ -673,7 +673,7 @@ push_constant (int (*in_char)(VOID), int conv_base)
bc_multiply (divisor, mult, &divisor, 0);
digits++;
in_ch = in_char();
- if (in_ch < 36 && in_ch >= conv_base) in_ch = conv_base-1;
+ if (in_ch < 16 && in_ch >= conv_base) in_ch = conv_base-1;
}
bc_divide (result, divisor, &result, digits);
bc_add (build, result, &build, 0);