Commit Graph

2463 Commits

Author SHA1 Message Date
tg 1d487d9163 by request of gecko2@ make “doch” keep stdin at slight lack of privacy 2013-08-10 13:43:50 +00:00
tg 247e20c524 • Completely overhaul prompt length calculation and
prompt display routines; make Emacs and Vi share
  code, permitting reducing of duplication and code
  removal as well as more consistent behaviour; put
  some common code into shared helper functions, too
• New x_adjust() logic (Emacs mode): when determining
  what portion of a line to render use a much more
  sophisticated algorithm and try to fill up ⅔ of the
  total screen width (with line and prompt both) also
  as wished from Steffen Daode Nurpmeso
2013-07-26 20:33:39 +00:00
tg 472bc350b5 TGIF, drinking-beer, Sysadmin Appreciation Day commit:
• As requested by Steffen Daode Nurpmeso, enlarge the
  amount of command characters shown in job handling
2013-07-26 20:33:24 +00:00
tg 3876b38220 Steffen Daode Nurpmeso found an actual bug:
Whenever the SIGEXIT trap was set (to anything, really)
syntax errors and interruptions were not ignored any more
in an interactive shell (where they should be, unless
set -e is used); fix that.

tbd: traps should probably only be marked as pending
and run for LLEAVE/E_NONE
2013-07-25 18:07:47 +00:00
tg c7f483c16f also protect the icon file from accidental deletion, and merge the cases 2013-07-25 17:01:03 +00:00
tg 5b35b869f1 Apply patch from: Steffen "Daode" Nurpmeso for testing -i vs. EXIT trap 2013-07-25 16:41:30 +00:00
tg 861890f7fa add the desktop shortcut / icon from mksh/Win32 so it may be used by everyone for mksh/Unix too 2013-07-25 16:18:25 +00:00
tg fb1c2ee862 more checks for special char handling 2013-07-25 16:06:43 +00:00
tg aeea5fd22a rewrite lots of “elif test” into “case” statements
(except those where the condition isn’t related)
2013-07-25 15:54:33 +00:00
tg 31d36b6611 Plan 9 support patch from Jens Staal 2013-07-25 15:43:59 +00:00
tg 8d0a5e6dbe align the compile-time asserts double-check struct size with padding 2013-07-25 15:36:18 +00:00
tg 35710c6461 disable utf8-mode for hd function (temporarily) 2013-07-25 14:02:02 +00:00
tg b46001ad4a fix another clobbered-by-setjmp/longjmp warning 2013-07-24 18:03:57 +00:00
tg e495fde858 Fix apparent programming mistake (newblock doesn’t imply newenv)
that caused “echo ${|true;}$(true)” to segfault; problem reported
by pshevtsov and wbx@ in IRC (thanks!); fix sponsored by tarent
2013-07-24 12:39:28 +00:00
tg 4bee63495a simplify 2013-07-21 20:44:44 +00:00
tg ead77623d3 Fix most “set -x” problems (LP#1179287)
• “set -x” manually (cmdline too) snapshots fd#2 now
• “set -o inherit-xtrace” introduced; default still enabled
• reverted iodup printing to pre-R45 behaviour
• made Flag(FXTRACE) a proper state machine
2013-07-21 18:47:24 +00:00
tg dd7b17e704 simplify 2013-07-21 18:39:21 +00:00
tg 3bc3e8665a fix postun in not evaluated side of e.g. ternary operator (LP#1187729) 2013-07-21 18:38:56 +00:00
tg bd795a83ae partial merge and full RCS ID sync with oksh
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.
2013-07-21 18:36:03 +00:00
tg 80a83f4f0b use ${SIZE-size} for lewellyn’s cross 2013-07-08 10:12:45 +00:00
tg bb4083d649 use ‘z’ shf printf modifier for out-of-memory message, now that we have it 2013-06-03 22:28:33 +00:00
tg 446fdbca3b from oksh: “for var in; do” shouldn’t be interpreted as “for var; do” (POSIX) 2013-06-03 22:28:17 +00:00
tg 8e6b0f712a support n̲o̲t̲ fork(2)ing for -T (by prepending the tty with ‘!’); especially useful on Linux since our own setsid(2) is more annoying; gets rid of the need for oneit_lite and similar hacks; WARNING: also removes chown/chmod on the tty! 2013-06-03 22:28:06 +00:00
tg 4e1196239a RCSID sync with oksh (fixed by us 4 years ago already) 2013-06-03 22:27:42 +00:00
tg 6aa08008b3 replace warnings for sig_t detection 2013-06-03 22:27:15 +00:00
tg 8256f266ff fix a number of warnings and other issues:
• sig_t detection was a bit insane, it is a function-pointer type after all
• fix uninitialised variable in c_select which led to mistakenly accepting
  invalid (nōn-numeric) input and acting, randomly, upon it
• keep SIGCHLD blocked in child after forking longer, for job list manip
• block SIGCHLD ifdef DEBUG_LEAKS to not run job foo during/after afreeall
• fix annoying ISO C90 vs. C99 (un)signed constant warning
2013-06-02 03:09:17 +00:00
tg d16705415a -Wunused-macros 2013-06-01 20:34:01 +00:00
tg ec1bc74d41 pull some quoting fixes from oksh; original patch from Alexander Polakov 2013-06-01 00:15:58 +00:00
tg d5eda34c8b j_sigchld may also run outside of interrupt context, so better save errno 2013-05-31 23:59:07 +00:00
tg 49d1ebfb71 Replace wcwidth code by mine based on Unicode 6.2.0 2013-05-31 23:27:14 +00:00
tg 21ee1a8411 prevent indirect recursion loops for namerefs; found by ormaaj, thanks! 2013-05-31 22:47:14 +00:00
tg 407734d305 meh, wrong gcc flag 2013-05-22 19:24:32 +00:00
tg c8a3127ea7 • fix error in warning fix (hah!)
• if GCC add -Wno-deprecated for dietlibc (and others) idiocy
2013-05-22 18:56:50 +00:00
tg 69a6777e42 remove the remark that lksh is not suitable for /bin/sh
(as, on some systems and for some pedants, it may be *better* suited
 due to its broken use of the host C “long” data type for arithmetics)
but warn that this can only work with -DMKSH_BINSHPOSIX really
2013-05-22 18:18:06 +00:00
tg d4bf779c7e also from Sylvestre Ledru’s clang-using Debian buildd, quieten another configure time warning; log before running that /dev/{null,tty} exist (with ls -l, so we see they’re actual devices) 2013-05-08 11:30:45 +00:00
tg a072c63fe8 declare thiswillneverbedefinedIhope to silence some configure time warnings 2013-05-08 11:16:19 +00:00
tg f02f8afe6e • don’t accidentally remove lksh.1 from the srcdir for in-srcdir builds
• fix post-build non-‘-Q’ output for lksh

both discovered in Fedora; thanks rsc
2013-05-05 13:38:00 +00:00
tg 1d0409d932 implement VALSUBs 2013-05-02 21:59:54 +00:00
tg 54a698d564 pimp the hexdump function 'hd' for when there is none 2013-05-02 21:46:29 +00:00
tg ff42a866e9 implement set -o pipefail 2013-05-02 20:28:15 +00:00
tg 0465f0a0de more int → unsigned 2013-05-02 20:23:09 +00:00
tg f0f34eb7b6 • Allow setting both -o posix and -o sh (although only in the same
command; setting one still unsets the other at first)
• Change subst_exstat to be conformant unless -o sh is set and -o posix isn’t
• In lksh, make subst_exstat (newly) conformant if -o posix
• New MKSH_BINSHPOSIX to accompany MKSH_BINSHREDUCED
• Sync lksh manpage precisely
2013-05-02 20:21:45 +00:00
tg f2906c79df for Yofuh: implement Emacs mode PgUp as Vi insert mode CurUp 2013-05-02 15:33:30 +00:00
tg 689c179254 sync and be even more explicit
XXX some day, write the *precise* delta of MKSH_LEGACY_MODE into lksh.1
2013-04-27 19:16:27 +00:00
tg 3674320e2e x_cols is a signed long in lksh; unbreak "set -o" and other print_columns using code 2013-04-27 19:09:13 +00:00
tg 0fb44301ef can test wraparound not in lksh 2013-04-27 18:56:41 +00:00
tg dc94c3d205 after enough complaints by POSIX sh advocates,
• make parsing numbers with leading digit-zero as octal independent of
  mksh/lksh and dependent on set -o posix; adjust manpages to match
• warn about these changes and why mksh uses 32-bit consistent arithmetics
  and point people to lksh for host-long undefined-behaviour arithmetics
• point out, explicitly, that it is *legal* for the operating environment
  to make 'print $((2147483647 + 1))' (on a 32-bit system; adjust for a
  64-bit system) to run 'rm -rf ~ /' instead
2013-04-27 18:50:25 +00:00
tg 496988e27a add lksh manpage formatting support
do not add it as regular mksh manpage, we do not ship lksh
2013-04-27 18:22:47 +00:00
tg c3b93834b0 lksh also reads $ENV so make sure it doesn’t try this one 2013-04-27 18:19:44 +00:00
tg 0634dd5ad2 move mircvs://contrib/hosted/tg/deb/mksh/debian/lksh.1
\ to mircvs://src/bin/mksh/lksh.1
2013-04-27 18:13:58 +00:00