Commit ID: 1005D4345213B9AFDA7
CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2019/08/01 20:02:34 UTC
Modified files:
bin/mksh : shf.c
Log message:
improve crlf to lf conversion
Do not depend on 'end'. Instead, check the last consecutive indices.
If end is not NULL and ncopy is larger than bsize, ncopy is truncated to
bsize. In addition, if buf[-2] == '\r', '\r' is replaced with '\n' even
if buf[-1] != '\n'. For example,
0123456789
...r.....n
Let bsize = 5, ncopy = 10. Then buf will point to index 5. BTW,
buf[-1](index 4) is not '\n'. Nevertheless '\r' of buf[-2](index 3) will
be replaced with '\n'. This is wrong.
From: KO Myung-Hun <[email protected]>
To generate a diff of this changeset, execute the following commands:
cvs -R rdiff -kk -upr1.98 -r1.99 src/bin/mksh/shf.c