git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Kevin Daudt <me@ikke.info>
Cc: git@vger.kernel.org,
	"brian m. carlson" <sandals@crustytoothpaste.net>,
	Lars Schneider <larsxschneider@gmail.com>
Subject: Re: [PATCH] t0028: fix wrong octal values for BOM in setup
Date: Mon, 11 Feb 2019 14:42:49 -0800	[thread overview]
Message-ID: <xmqq36ougd5i.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20190211213818.4941-1-me@ikke.info> (Kevin Daudt's message of "Mon, 11 Feb 2019 22:38:18 +0100")

Kevin Daudt <me@ikke.info> 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 <me@ikke.info>
> ---
> 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.

      reply	other threads:[~2019-02-11 22:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-11 21:38 [PATCH] t0028: fix wrong octal values for BOM in setup Kevin Daudt
2019-02-11 22:42 ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq36ougd5i.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=larsxschneider@gmail.com \
    --cc=me@ikke.info \
    --cc=sandals@crustytoothpaste.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).