git: 3708b615c354 - stable/12 - sh: Allow more scripts without #!

Mark Millard marklmi at yahoo.com
Sun Jan 31 01:08:50 UTC 2021


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)



More information about the dev-commits-src-branches mailing list