Thread (1 message) 1 message, 1 author, 2019-02-11

Re: [PATCH] t0028: fix wrong octal values for BOM in setup

From: Junio C Hamano <hidden>
Date: 2019-02-11 22:42:54

Kevin Daudt [off-list ref] writes:
The setup code uses octal values with printf to generate a BOM for
UTF-16/32 BE/LE. It specifically uses '\777' to emit a 0xff byte. This
relies on the fact that most shells truncate the value above 0o377.

Ash however interprets '\777' as '\77' + a literal '7', resulting in an
invalid BOM.

Fix this by using the proper value of 0xff: '\377'.

Signed-off-by: Kevin Daudt <redacted>
---
I do wonder why this code is using octal values in the first place,
rather than using hex values.
Most likely for portability to non GNU and less widely used systems.

Thanks for spotting these \777s.

Will apply.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help