Commit Graph

2839 Commits

Author SHA1 Message Date
tg 54a8067fd2 add print -A for R53 2016-07-25 20:38:04 +00:00
tg aa9fa0ebfe add a testcase as documentation (why POSIX isn’t everything); fix comments 2016-07-25 20:36:28 +00:00
tg c3e794c4d0 rework string pooling; disable our own (rely on compiler’s)…
• 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
2016-07-25 00:04:48 +00:00
tg 816614d3ce re-add realpath to prefer-external-if-argument, needed by Debian 2016-07-24 23:11:51 +00:00
tg e8bbf79d8c invent builtin flags instead of special-casing cat and printf for prefer-external-over-builtin stuff 2016-07-24 23:10:04 +00:00
tg 5401a55a98 optimise away code for a case that’s almost unlikely to happen; fix pasto(?) 2016-07-24 23:07:19 +00:00
tg e0e63c65e6 fix issues with home directory replacement, from Torsten Sillke:
• if $PWD = ${HOME}foo, no longer show as ~foo in PS1
• simplify ~, ~+, and ~- exactly as $PWD is upon shell entry
  (fixes HOME=/home/./foo but PWD=/home/foo)
2016-07-24 23:05:52 +00:00
tg 8370c0dd4d experimentally use MKSH_CLRTOEOL_STRING instead of lots of spaces followed
by lots of backspaces for many clearing scenarios; requested by tmux user
slagtc on IRC
2016-07-12 23:07:10 +00:00
tg 353108cb25 move MIN_{COL,LIN}S here, only user left (edit.c has its own sanity checks)
and lower them (no need to respect edit.c’s, this is only sanity against OS)
2016-07-12 23:06:26 +00:00
tg a41a62dad7 efficient $(<<<foo) and $(<<EOF … ) implementation, requested by izabera 2016-06-26 00:44:59 +00:00
tg 582e745958 since we already support XSI test -a/-o, they better behave 2016-06-26 00:44:25 +00:00
tg 97d1d5e4fe fix var=<< implementation 2016-06-26 00:09:35 +00:00
tg c52133cc4e emit QCHAR '\n' reentrancy-safe 2016-06-26 00:07:31 +00:00
tg a3cc4ffacb testcases contributed by carstenh 2016-06-26 00:06:43 +00:00
tg e4f55499c0 hexdump the NUL away 2016-06-26 00:04:30 +00:00
tg df1d7339be I hate our patch(1), it’s not NUL-safe… 2016-06-26 00:00:53 +00:00
tg 262ae5a436 fix most of the ambiguous ${[prefix] var [op [word]]} corner cases
prodded by izabera and carstenh; resolution is:
• you can’t trim a vector in mksh, still (consider ${@:-1})
• future POSIX will require non-empty “word” for most “op”s
• dissolve in order of standard → extension
• dissolve to prefer “op” over “prefix” where still necessary, mostly
2016-06-25 23:55:00 +00:00
tg 1563b70658 abort read builtin in case of read(2) errors
noticed by arekm, persuaded by jilles, compared with other equivalent
pieces of code reading in mksh
2016-06-25 23:52:46 +00:00
tg 2dde57ab54 document ^U key binding advice
this is “GNU bash mode”, for bleb via IRC
2016-06-25 23:52:06 +00:00
tg 8a93f7d1dd improve description of default Emacs mode keybindings 2016-06-25 23:51:21 +00:00
tg 58f36a9f3a increase default input line, from PLD Linux
(for as long as we still have the size static, and !MKSH_SMALL)
2016-06-25 23:49:50 +00:00
tg b5127b03be deprecate *not* using MKSH_CONSERVATIVE_FDS; named fds coming soon
partially reverts commitid 10048752E6271CABA24 (the manpage, mostly)
and adds a deprecation warning at build time; suggested by izabera
2016-06-25 23:49:13 +00:00
tg f555d1d524 premark <<< for deletion, >>> for SAR, ^< and ^> for ROL/ROR
cf. http://david.tribble.com/text/c0xrot.htm

noted by izabera
2016-06-25 23:48:10 +00:00
tg 8d811d19d4 typo, found by Joerg Schilling 2016-05-31 19:59:53 +00:00
tg 9ab9ee194c fix shf.c-internal buffer overread on printing digits,
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
2016-05-17 15:36:35 +00:00
tg 55e51d9580 add, with a warning, regression testcases for:
• trailing combining character
• ${!#} and friends

the warning is: pid_t is signed (so PIDs could be negative) and may be
rather long, in some cases even longer than a C “long”; we’ll need to
handle this by adding checks (sizeof pid_t=gid_t, sizeof pid_t must be
either mksh_ari_t or u_short) and code (always print $$/$! as unsigned,
set unsigned attribute on $BASHPID and friends)
2016-05-05 22:58:19 +00:00
tg 92833fc6ce fix utf_widthadj/utf_skipcols handling for the remaining cases I can spot 2016-05-05 22:56:15 +00:00
tg 3d130b606a give C_VAR1 precedence over display variable name; izabera pointed out,
rightfully, that, in POSIX shell, ${!#} is defined, and ${!#123} should work
2016-05-05 22:45:58 +00:00
tg b6e438037f collapse uselessly nested if 2016-05-05 22:19:04 +00:00
tg 370b3e6008 fix trailing combining characters in all shf functions 2016-05-05 21:38:12 +00:00
tg 152eee2085 handle combining characters at the end of the string correctly 2016-05-05 21:33:46 +00:00
tg 2e74da0953 fix potential off-by-one 2016-05-05 21:29:24 +00:00
tg 3da248755a bump 2016-04-14 15:38:38 +00:00
tg 1cc8f76f07 fix order of bounds checks; inspired by NetBSD#50747 2016-04-14 11:51:26 +00:00
tg 83cde99aee fix redefining FKSH functions as !FKSH (e.g. the smores change) 2016-04-09 16:41:07 +00:00
tg da085fd7d2 simplify 2016-04-09 16:33:23 +00:00
tg 4c4131dddf commitid 10056D5D8AF01B31531 broke fix for Debian #783978 (add testsuite) 2016-04-09 13:55:12 +00:00
tg 838833ba86 pass on RCSID 2016-03-12 20:45:38 +00:00
tg 842e353011 lintian has new spelling warnings 2016-03-06 21:01:28 +00:00
tg 1a795b7cdb expanded tests for command/whence, from Martijn Dekker 2016-03-05 15:39:36 +00:00
tg 4ccfd5fab5 document upcoming set +o changes; bump 2016-03-04 18:28:42 +00:00
tg cb0604767f address latest Debian gcc-snapshot’s warnings (some actual bugs!) 2016-03-04 14:26:16 +00:00
tg e8d6b5c2a3 render PDF manpages in PA4 paper size ipv DIN ISO A4 paper size 2016-03-03 23:51:31 +00:00
tg fdfd7a2ab8 collapse if, also to avoid braces warning 2016-03-01 20:28:33 +00:00
tg 85c377dfc2 don’t read past buffer for empty nameref targets (fmunozs, Valgrind) 2016-03-01 20:06:15 +00:00
tg 539714f78a there was a comment on 1015; change comments to match, no code change 2016-03-01 19:22:31 +00:00
tg c2bdb1b9dd check not-begun heredocs at EOF earlier
izabera reported they were not caught with “set -n”
2016-03-01 18:30:05 +00:00
tg 25a564460e explicitly block SIGEXIT and SIGERR in case some idiot defines it 2016-03-01 18:29:48 +00:00
tg 7c93759f66 fix invalid read for ksh93-style base-1 integers
(valgrind; reported by fmunozs via IRC, thanks!)
2016-03-01 18:29:38 +00:00
tg 819229fa50 also flush syntax-failed or interrupted input into the history 2016-03-01 18:00:08 +00:00