1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00
cde/src/cmd/ksh93/include
Johnothan King 764acefaf1 read -r -d should not ignore -r
This bug was previously reported in att/ast#37.
Ksh ignores `-r` when `read -r -d` is run because when
the bit for `D_FLAG` is set, the bit for `R_FLAG` is unset
as a side effect of setting `D_FLAG`. The following set
of commands fails to print a backslash:

$ printf '\\\000' | read -r -d ''
$ echo $REPLY

The fix for this bug is to set `D_FLAG` with `D_FLAG + 1`,
which prevents `R_FLAG` from being unset. This bugfix
has been backported from ksh93v- 2013-10-10-alpha.

src/cmd/ksh93/bltins/read.c:
 - Set `D_FLAG` with `D_FLAG + 1` to prevent the bit for
   `R_FLAG` from being unset.

src/cmd/ksh93/tests/builtins.sh:
 - Add the regression test for `read -r -d` from ksh93v-.
2020-06-16 13:49:23 +01:00
..
argnod.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
builtins.h Make 'source' a regular built-in 2020-06-15 11:33:44 +02:00
defs.h Fix 'test'/'[' exit status >1 on error in arithmetic expression 2020-06-12 01:45:15 +02:00
edit.h Fix 80 typos in comments 2020-06-12 01:45:12 +02:00
env.h Fix 80 typos in comments 2020-06-12 01:45:12 +02:00
fault.h Fix 80 typos in comments 2020-06-12 01:45:12 +02:00
fcin.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
history.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
io.h rm "I/O error" error msg; just keep >0 exit status (re: 9011fa93) 2020-06-12 01:45:18 +02:00
jobs.h Revert job locking patch (re: 07cc71b8, 58560db7) 2020-06-15 03:20:45 +02:00
lexstates.h Fix 80 typos in comments 2020-06-12 01:45:12 +02:00
name.h Fix 80 typos in comments 2020-06-12 01:45:12 +02:00
national.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
nval.h Refactor new b_hash(); better hash table clear (re: d8428a83) 2020-06-12 01:45:18 +02:00
path.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
regress.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
shell.h Fix 80 typos in comments 2020-06-12 01:45:12 +02:00
shlex.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
shnodes.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
shtable.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
streval.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
terminal.h Fixes for implicit declaration warnings 2020-06-14 09:55:08 -04:00
test.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
timeout.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
ulimit.h Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
variables.h Remove code related to long-dead 3DFS research project 2020-06-12 01:45:17 +02:00
version.h read -r -d should not ignore -r 2020-06-16 13:49:23 +01:00