Converting CR+LF to LF in blocking_read() which is a underlying read
function, may affect to the functions which do not perform line-based
operation.
modified: funcs.c
modified: main.c
modified: misc.c
modified: os2.c
modified: shf.c
• if HAVE_STRING_POOLING is set to 1
• if HAVE_STRING_POOLING is set to 2 and not GCC < 4 is used
• if HAVE_STRING_POOLING is not set to 0 and LLVM or GCC >= 4 is used
Closes: LP#1580348
introduced by the utf_skipcols()-related fixes, more
specifically the check for combining multibyte characters
past end of given width (bogus mixed-up semantics we have here)
by reïntroducing the NUL byte from commitid 1005474EE1E4024A4E4
• ord() new, From: Daniel Richard G. <skunk@iSKUNK.ORG>
‣ used in some places
• (c - '0') → ksh_numdig(c) # may take *x++ argument
• (c - 'A') → ksh_numuc(c) # may NOT take *x+= argument
‣ idem for ksh_numlc(c) and 'a'
‣ these need changing for EBCDIC
‣ add testsuite for this
• use macros more, they exist already often
• use digits_lc[foo] instead of ('0' + foo), especially for letters
• caught another ksh_eq case…
• also caught a maybe-UB overflow check, but we don’t have TIME_T_MAX ☹
merged:
• new regression tests
• check.pl (tests/th) better tmpfile handling
• exec.c 1.50: POSIX specifies that for an AND/OR list,
only the last command's exit status matters for "set -e"
• ksh.1 1.147: document the above
• eval.c 1.39: “Make $(< /nonexistent) have the same behaviour
as $(cat /nonexistent) wrt. errors (do not unwind and do not
treat this as fatal if set -e is used).”
‣ additionally make shf_open() return errno and actually show
the error message from the system
• regression-39 test: remove the “maybe” marker
‣ but decide on correct POSIX behaviour
already been fixed in mksh:
• check.pl (tests/th) exit 1 if tests fail
not merged:
• main.c 1.52: run traps in unwind() before exiting;
I’m pretty sure this is already working as-should in mksh
• eval.c 1.38: “Commands executed via `foo` or $( bar ) should
not inherit "set -e" status.” As discussed in IRC, this is
just plainly WRONG.
• mail.c was removed anyway
• we do not use “long long” in mksh, since it’s not in ANSI C89
instead, we probably need some 64-bit ops in the long run, but we can
use some host types (might want to use time_t for tv_sec, but we cannot
print that yet); might need to handle them in some generic manner…
that get used, plus one for the realpath-1 regression test; also make
sys_siglist_decl detection nicer and poison strerror() with non-const
return value ifdef DEBUG, make it always const
– possible integer overflows in memory allocation, mostly
‣ multiplication: all are checked now
‣ addition: reviewed them, most were “proven” or guessed to be
“almost” impossible to run over (e.g. when we have a string
whose length is taken it is assumed that the length will be
more than only a few bytes below SIZE_MAX, since code and
stack have to fit); some are checked now (e.g. when one of
the summands is an off_t); most of the unchecked ones are
annotated now
⇒ cost (MirBSD/i386 static): +76 .text
⇒ cost (Debian sid/i386): +779 .text -4 .data
– on Linux targets, setuid() setresuid() setresgid() can fail
with EAGAIN; check for that and, if so, warn once and retry
infinitely (other targets to be added later once we know that
they are “insane”)
⇒ cost (Debian sid/i386): +192 .text (includes .rodata)
• setmode.c: Do overflow checking for realloc() too; switch back
from calloc() to a checked malloc() for simplification while there
• define -DIN_MKSH and let setmode.c look a tad nicer while here
a string buffer whose window size is currently 32 (initial), your data
is 96 bytes, this routine used to resize the buffer to 64, append your
first 64 bytes to it (no matter if there's already something in it)
and then writes the remaining bytes to stdio fd instead of the string…
if it doesn’t SIGABRT before
discovered by wbx@ – thanks – bug inherited from pdksh 5.2.14 (AD 1999)
I read, IIRC in the Cederqvist, that 'cvs tag' sets a sticky tag onto
the cwd… it doesn’t, apparently. (I actually like it better this way,
but one needs to know!)