NetBSD/bin
martin c99243683a Pull up following revision(s) (requested by kre in ticket #1549):
bin/sh/miscbltin.c: revision 1.51
	bin/sh/miscbltin.c: revision 1.52

PR bin/56972  Fix escape ('\') handling in sh read builtin.

In 1.35 (March 2005) (the big read fixup), most escape handling and IFS
processing in the read builtin was corrected.  However 2 cases were missed,
one is a word (something to be assigned to any variable but the last) in
which every character is escaped (the code was relying on a non-escaped char
to set the "in a word" status), and second trailing IFS whitespace at
the end of the line was being deleted, even if the chars had been escaped
(the escape chars are no longer present).

See the PR for more details (including the case that detected the problem).

After fixing this, I looked at the FreeBSD code (normally might do it
before, but these fixes were trivial) to check their implementation.

Their code does similar things to ours now does, but in a completely
different way, their read builtin is more complex than ours needs to
be (they handle more options).   For anyone tempted to simply incorporate
their code, note that it relies upon infrastructure changes elsewhere
in the shell, so would not be a simple cut and drop in exercise.

This needs pullups to -3 -4 -5 -6 -7 -8 and -9 (fortunately this is
happening before -10 is branched, so will never be broken this way there).

 -

Don't output the error for bad usage (no var name given)
after already writing the prompt (set with the -p option).

That results in nonsense like:
	$ read -p foo
	fooread: arg count

While here, improve the error message so it means something.

Now we will get:
$ read -p foo
read: variable name required
Usage: read [-r] [-p prompt] var...

[Detected by code reading while doing the work for the previous fix]
2022-10-27 16:14:42 +00:00
..
cat Add cross reference to tac(1). 2017-10-02 08:24:17 +00:00
chio typo: unvalid -> invalid 2017-10-16 17:08:35 +00:00
chmod Use Ex. 2017-07-04 06:46:51 +00:00
cp Pull up following revision(s) (requested by skrll in ticket #1348): 2021-09-23 10:11:02 +00:00
csh Pull up following revision(s) (requested by simonb in ticket #853): 2020-04-25 10:50:47 +00:00
date Remove trailing whitespace and Tn macro. 2018-01-27 18:59:38 +00:00
dd When buffers are at least page sized, explicitely request page alignment. 2019-03-23 09:33:16 +00:00
df -G cannot be specified alongside -i or -P. 2018-08-26 23:34:52 +00:00
domainname
echo Use Ex. 2017-07-04 06:46:51 +00:00
ed Unifdef compatibility for broken realloc. 2019-01-04 19:13:58 +00:00
expr Add a missing check to handle correctly 0 * 0 in expr(1) 2018-06-27 17:23:36 +00:00
hostname
kill Reverse a decision made when the printsignals() routines from 2018-12-12 20:22:43 +00:00
ksh Pull up following revision(s) (requested by christos in ticket #1212): 2021-02-23 18:53:31 +00:00
ln Update usage to include -w 2018-08-26 23:01:06 +00:00
ls Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
mkdir Pull up following revision(s) (requested by kre in ticket #1347): 2021-09-23 10:09:20 +00:00
mt Bump date for previous. 2018-09-01 07:26:56 +00:00
mv Use Ex. 2017-07-04 06:50:04 +00:00
pax Pull up following revision(s) (requested by mrg in ticket #1263): 2021-04-30 14:07:02 +00:00
ps Pull up following revision(s) (requested by simonb in ticket #1244): 2021-04-06 18:07:28 +00:00
pwd Use Ex. 2017-07-04 06:50:04 +00:00
rcmd Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
rcp Pull up following revision(s) (requested by aymeric in ticket #890): 2020-05-07 17:01:13 +00:00
rm Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
rmdir PR/48182: Fix rmdir -p handling of top-level (root) directory. 2017-08-10 22:52:13 +00:00
sh Pull up following revision(s) (requested by kre in ticket #1549): 2022-10-27 16:14:42 +00:00
sleep Deal with overflow when the sleep duration given is a simple 2019-03-10 15:18:45 +00:00
stty Remove Tn. 2017-10-30 15:38:52 +00:00
sync Drop main() prototype. 2016-09-05 01:00:07 +00:00
test Pull up following revision(s) (requested by dholland in ticket #1507): 2022-08-29 16:04:26 +00:00
Makefile
Makefile.inc