Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Jan 2021 17:08:40 -0800
From:      Mark Millard <marklmi@yahoo.com>
To:        jilles@stack.nl, dev-commits-src-branches@freebsd.org
Subject:   Re: git: 3708b615c354 - stable/12 - sh: Allow more scripts without #!
Message-ID:  <140C16CB-E1E5-49E9-979D-0C707E678CE2@yahoo.com>
References:  <140C16CB-E1E5-49E9-979D-0C707E678CE2.ref@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Jilles Tjoelker jilles at stack.nl wrote on
Sat Jan 30 23:09:15 UTC 2021 :

. . .
> > >>> +	 * In order to reject common binary files such as PNG images, check
> > >>> +	 * that there is a lowercase letter or expansion before the last
> > >>> +	 * newline before the NUL character, in addition to the check for
> > >>> +	 * the newline character suggested by POSIX.
> . . .

vs. an alternate description:

> The loop continues until the first NUL byte and will return false (not
> binary) when it encounters any newline after an ASCII lowercase letter,
> '$' or '`'.

I find the comment in the code much harder to derive the
intent from.

ALTERNATE (partial?) WORDING FOR CODE COMMENT? :
In order to reject common binary files such as PNG images, reject
(return false) when there is a lowercase letter or expansion
anywhere before any newline that is before the first NUL character.
END ALTERNATE WORDING

===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?140C16CB-E1E5-49E9-979D-0C707E678CE2>