Commit Graph

2068 Commits

Author SHA1 Message Date
tg 69e1312265 fix real-life example From: Andrew Kudryashov <andrewinsilenthill@gmail.com>
in <CABNd6wz3SSRWamUNQ-BNcp7z0pthOR156=Zy3qBYmXhTjvoYsg@mail.gmail.com> but
by a different (cheaper) method than the one in his patch from message-id
<CABNd6ww7zFUQ4Ho2zQQzQyERy==8Hqg_y12Acmj1sF6ka4b4KQ@mail.gmail.com>:

when completing, always replace the olen text with the new one, and only
then take the length of the x_expand()ed nlen text to compare and check
whether to set completed=true; this also means:

$ ls foo\+/<tab>
          ↓
$ ls foo+/

this matches reality even better and saves us a couple of string traversals
2012-03-23 21:34:47 +00:00
tg 8e2d84f455 address <CABNd6wz3SSRWamUNQ-BNcp7z0pthOR156=Zy3qBYmXhTjvoYsg@mail.gmail.com>
From: Andrew Kudryashov <andrewinsilenthill@gmail.com>

Hunk 1: “Also, I found that x_escape() does funny things to sequences
of backslashes” which was caused by improper quoting; use an empirical
list of chars to escape (only 0x20‥0x7E, everything else is SOL anyway)

Hunk 2: “and "\*" will be appended” was actually correct, but not in
all cases; handle these cases (and break 0x02 in filename)
2012-03-23 21:15:34 +00:00
tg 3795e667c5 drop use of the NOT macro, [^foo] ≠ [!foo] anyway, and we’re not gonna change that 2012-03-23 20:07:13 +00:00
tg c5cc22a13f efficient debug-to-file output (/tmp racy, but hey) 2012-03-23 19:38:12 +00:00
tg 4f043002be another int → bool 2012-03-23 18:58:15 +00:00
tg 2baa40a768 • printf(1) on BSD/OS 4.1 does not play nice with NUL characters
⇒ use print builtin, everything else works; reported by RT
• extend the testsuite, ensure print can do NUL correctly
2012-03-20 16:48:12 +00:00
tg e141394a83 RCSID sync from oksh; reduce hash table #elements if !MKSH_SMALL to speed up 2012-03-03 21:30:59 +00:00
tg 82ebd9320b distinguish between Minix 3 and Ninix 3 2012-03-03 21:30:13 +00:00
tg bc039caa9f no "struct timezone" on Minix3, despite its manpage 2012-03-03 21:13:50 +00:00
tg aeaf3e27ef drop Android-specific lsmod builtin (for now), they don’t use it anyway 2012-03-03 19:28:45 +00:00
tg 3e0abff926 -DMKSH_SMALL no longer implies -fno-inline 2012-03-03 19:27:07 +00:00
tg 9f3299df4d fix regression in mirtoconf output introduced in cid 1004EFE6D783E94B328 2012-02-17 13:59:56 +00:00
tg 753891419d 10:41⎜«RT|Chatzilla:#!/bin/mksh» mira|AO: 12:08 < RT|AO> a bit fun compiling mksh in SkyOS 5.0.6753 ;-)
http://pastebin.com/GHPm1B7B
10:41⎜<mira|AO:#!/bin/mksh> .oO(wtf is SkyOS?)
10:42⎜<mira|AO:#!/bin/mksh> shf.c:453: warning: format '%zd' expects type 'signed size_t', but argument 4
     ⎜    has type 'ssize_t'
10:42⎜<mira|AO:#!/bin/mksh> lol…
10:42⎜<mira|AO:#!/bin/mksh> I’ve seen (and fixed!) that in dietlibc too, recently
10:43⎜«RT|Chatzilla:#!/bin/mksh» http://en.wikipedia.org/wiki/SkyOS
10:43⎜<mira|AO:#!/bin/mksh> shell-init: error retrieving current directory: getcwd: cannot access parent
     ⎜    directories: Not a character device ←←← huh?!?!?!
10:46⎜<mira|AO:#!/bin/mksh> looks like their POSIX layer has got issues (other than this shell-init
     ⎜    thing, umask and checks for existence upon open() are broken)
10:46⎜<mira|AO:#!/bin/mksh> but mksh is usable, I'd say
10:46⎜<mira|AO:#!/bin/mksh> “mostly”
10:46⎜<mira|AO:#!/bin/mksh> let me commit that
10:46⎜«RT|Chatzilla:#!/bin/mksh» funny posix layer bug, just like "unexpected exit status 1 (signal 1),
     ⎜    expected 1" signal bug in BeOS5
2012-02-17 09:49:45 +00:00
tg 68e73536a0 RCSID sync with OpenBSD 5.1 ksh (we did the same checks ages ago) 2012-02-11 22:45:04 +00:00
tg c7c8637e63 let struct proc allocate 64 chars even on !ILP32 platforms
(don’t fragment memory that much)
2012-02-06 17:49:52 +00:00
tg 929bc9ee9e make jobs reporting deal with UTF-8 (in utf8-mode)
reported by Andrew Kudryashov, 10x
2012-02-06 17:42:24 +00:00
tg bee3bbaaf8 reduce stack usage a bit (several candidates for more, including $CC itself…) 2012-01-29 01:41:15 +00:00
tg 8b023994de shave off some redundancy 2012-01-14 19:20:17 +00:00
tg e538a90e57 I hate Cygwin. Adjust sed for the fact that an mksh called as mksh.exe gets mksh in argv[0]; reported by Chris Sutcliffe 2012-01-05 11:52:48 +00:00
tg c06e3979a8 I hate having to do those year bumps… 2012-01-04 22:38:33 +00:00
tg ac29bad3fe fix regression escaping single-char strings 2012-01-04 19:09:36 +00:00
tg 801fdb10ca DTRT when commenting out the only instruction in an if block; spotted by RT 2012-01-04 08:56:27 +00:00
tg d7d41d9210 disable tcc’s bounds checker for now; fixes SIGSEGV-on-start on i386 (Total failed: 0; Total passed: 424) 2012-01-03 16:14:39 +00:00
tg 7ff96c3086 fix gccism; found during testing with tcc 2012-01-03 16:03:22 +00:00
tg 2539450588 fix regression in jaredy’s security patch introduced in R35b
(cid 100487B467E068A55D6 and 10048949D196A7C1390) discovered
by Jb_boin: time with a not-TCOM subtree would now trash its
string argument (which is the loop variable for TFOR); amend
regression testsuite
2012-01-03 15:32:08 +00:00
tg 34036ec32e MSYS implies -DMKSH_ASSUME_UTF8=0 and thus can skip the test that’d fail 2012-01-03 01:40:15 +00:00
tg e1fa966570 if tcfn=a.exe pass mksh.exe, not mksh, to check.pl
also spotted by RT
2012-01-03 01:30:16 +00:00
tg 8a8535b321 oeps… 2012-01-03 01:01:44 +00:00
tg 2578c66b61 move linkage check (which uses sh.h INCLUDES_ONLY) to when all of its
prerequisites are actually fulfilled, i.e. evrn further down than with
the last commit doing this, and move some prerequisites of stuff that
has wandered outside the !INCLUDES_ONLY block with the compile-time
assert changes to the outside, too

fixes FTBFS on MSYS which has neither <stdint.h> nor uint32_t
reported by RT
2012-01-03 00:58:09 +00:00
tg 7564594bb8 bunch of warning fixes 2011-12-31 02:54:15 +00:00
tg 7ec1ae3771 followup for cid 1004EE408E1382C1752 and 1004EE40DDD498FBB0D:
do a mirtoconf run-time check (ugh) to see whether the CPU designers
smoked/were brain-dead or if we don’t actually need the manual check
2011-12-31 02:04:18 +00:00
tg 25f413bf7d first part of LP: #909818; ${name@#} will later be changed to ${name@#expr} where expr is the IV ipv 0 (eval.c:377ff) 2011-12-31 01:07:19 +00:00
tg 18dc21bd85 clang3 says: Branch condition evaluates to a garbage value 2011-12-31 00:52:22 +00:00
tg c8ee91f02d LLVM+clang scan-build found a dead store and I found an unneeded assert 2011-12-31 00:47:46 +00:00
tg 5dbff1d56c clang doesn’t decide whether -version or --version is to be used, grml… 2011-12-31 00:31:25 +00:00
tg d5edc79f5a gc-sections found size optimisation chances 2011-12-31 00:27:27 +00:00
tg efaa268a88 plug the most atrocious offenders in the persistent history code
to address LP: #906914 (if your history file is corrupt or you
reach the end of HISTLINES, you’re still SOL)

quadruple the standard value for HISTSIZE to help users avoid it;
it’s much better to set it yourself if using persistent history
though; half it on MKSH_SMALL though which defaults to not use it
anyway

also fix handling of larger files a bit and limit the size until
which the files are considered (currently to 96 MiB) until such
time as mmap will no longer be employed to deal in them when the
offending code has been replaced by a rewrite…
2011-12-31 00:23:42 +00:00
tg da9ce25524 put a bit of type safety into the history code 2011-12-30 21:00:32 +00:00
tg 38dcf950c9 • release flock after the lseek
• -1 not 0 is the safe “none” value for fds
2011-12-30 20:35:29 +00:00
tg 31bf077591 don’t clobber the tree used for printing IOACTs in process_TIF (LP: #907224) 2011-12-29 23:36:25 +00:00
tg bb51eee63c when doing tab completion partial inserts in UTFMODE, honour multibyte character boundaries (LP: #909025) 2011-12-29 23:36:10 +00:00
tg 4af399bd8d give dumptree an dumpioact helper 2011-12-29 22:54:22 +00:00
tg dd8925a475 ensure aliases in COMSUB are not expanded twice
spotted by Jilles Tjoelker again, thanks
2011-12-29 22:03:15 +00:00
tg 68e8b5ab7c disable looking for C99 support flag in compilers (and GCC extensions)
laffer1 just pointed me to n1570 and I must say I am shocked but not surprised
2011-12-18 02:20:09 +00:00
tg 7b89945505 use sane spelling of read-only consistently 2011-12-16 20:03:28 +00:00
tg 0b3d21702a fix ifs.sh; anonymous submission (mkt?), 10x 2011-12-16 20:03:12 +00:00
tg 5070ea2387 skip R/O check in an unevaluated ternary part; 10x jilles 2011-12-16 20:03:02 +00:00
tg 4748739523 eek, mira, don’t leave debugging code lying around 2011-12-11 18:07:45 +00:00
tg 986d999e58 make ^O work like it did before we introduced x_modified(), that is,
editing the refetched input line doesn’t let it restart (but ^R does)
2011-12-11 18:01:03 +00:00
tg e18f4d114a actually, behave with silent wraparound; results validated by bc(1) 2011-12-11 01:56:43 +00:00