Commit Graph

787 Commits

Author SHA1 Message Date
tg dc71f9b775 • remove an unneeded pair of double quotes
• convert another pair of 'em to “…”
2007-04-17 20:07:09 +00:00
tg b2d0d57468 change our coding style for shell:
we already do not 'function\nfoo\n{' for shell, like style(9) requires for
C programming, but 'function foo\n{' instead. however, we could treat the
function keyword as indentation initialiser and use 'function foo {' (on a
line for itself) – it looks different, unusual, but acceptable, and mksh's
own output (dumping with the “functions” builtin) does that too (although,
its indentation style sucks, but is legible enough)
2007-04-17 20:04:08 +00:00
tg 9cbff5af67 escape the quoting hell, use a function
tested on Interix
2007-04-17 20:00:37 +00:00
tg 1d6ae7d16b GNU/Cygwin32 sucks, as operating environment. Plain sucks. 2007-04-17 14:00:00 +00:00
tg c79cacdfa5 • from a MirOS point of view:
place most stuff from /etc/profile in /etc/skel/.mkshrc; admins must make
  sure to copy this file to users' homes on upgrade (benefit: non-login but
  interactive shells also get all the goodies); fix some quoting; simplify,
  reformat, change comments
• from an mksh point of view:
  slight internal changes in dot.mkshrc; external commands are now prefixed
  with “ulimit -c 0”; $TERM is defined; improvement in determining the host
  name (e.g. on Debian if a FQDN is not given); declare locals as such both
  in $PS1 and outside; remove superfluous quoting, quote properly; simplify
  hd alias, add rot13 alias; place RCS ID at the bottom
2007-04-16 18:54:37 +00:00
tg 680e8ebd3f if we read an utf-8 BOM, enable the utf8-hack flag (we can test for that on
mirbsd even because the main.c enabling is only run for interactive shells)
2007-04-15 12:28:38 +00:00
tg 2785ce3de4 • (re)implement shebang execution file parsing; this makes the “and which
do not start with a "#!shell" sequence” part of mksh(1) true again; this
  was probably lost in mksh R21 or so when I decided/saw that our kernel
  always parses shebang lines (code written myself, not taken from pdksh
  again or MirBSD kernel, but verified against both)
• bom+shebang execution now works, no need setting EXECSHELL in the test
• bump version
2007-04-15 12:09:57 +00:00
tg 40be0d9f04 commit a test (which mksh on MirOS BSD currently fails) to test if files
starting with an UTF-8 BOM before the shebang can be executed correctly;
this would succeed if either mksh parses the shebang line instead of re-
lying on $EXECSHELL or the kernel supports it

bsiegert@ ok's my attempts to fix this
2007-04-15 10:58:55 +00:00
tg 1692a6da66 ignore the UTF-8 Byte Order Mark at the beginning of the input (via a file
given to execute, standard input (interactive or not), via -c command line
argument, or after “eval”, but not for $(…) comsubs, at the beginning of a
subsequent line, or within a line, etc.); regression test for it

idea during my “week off” (despite the pain), bsiegert@ thinks it's good –
and utf-8 capable tools ought to be able to do this anyway
2007-04-15 10:45:59 +00:00
tg 67addd064f support crazy ones that still haven't gotten rid of zsh 2007-04-01 01:48:31 +00:00
tg e867a4c669 mirtoconf for large file support vars, requested by bsiegert@ 2007-03-19 22:58:19 +00:00
tg 7071cada42 • use wdcopy() not str_save() to duplicate an “encoded string”, whatever
• prevent out-of-bounds memory access, cought by glibc malloc on IA-64
2007-03-14 02:41:09 +00:00
tg dbf38a152d fix a typo and shrink it to 39 DIN A4 pages 2007-03-10 21:14:07 +00:00
tg b08848c7ff • improve description why we use -fno-tree-vrp; this is thanks
to http://blog.fefe.de/?ts=bb2654d4 by the way
• simplify a.out / a.exe distinguishation
2007-03-10 19:19:12 +00:00
tg 219bc99362 check for -fno-tree-vrp (existence and if it is required to würg around a gcc 4.1.1 bug) 2007-03-10 18:51:59 +00:00
tg 377dbe464a some gcc 4.1.2pre warning shutup 2007-03-10 18:16:28 +00:00
tg 95eaf0c9bb try to add -fstack-protector-all – it's in gcc 4.1+, so why not… 2007-03-10 17:29:53 +00:00
tg c61deaea27 remove unused utf_width(); bump vsn 2007-03-10 00:42:00 +00:00
tg db81d72dea in the utf-8 mode, invalid multibytes are now handled more strongly:
• if it's in x_literal() (“quote” / ^V) mode, it's accepted like now
• if it's a mb sequence start, it's rejected with a beep
• if it's a mb continuation, the whole sequence is silently rejected

this makes command line editing when accidentally hitting, e.g. with
my mircvs://contrib/samples/dot.Xmodmap, Mode_switch-x much more ro-
bust.
2007-03-10 00:36:44 +00:00
tg d306d5a9e4 fix setlocale check descr 2007-03-10 00:34:54 +00:00
tg 08ccbacdf6 bugfix: display UTF-8 control characters (U+0080..U+009F, i.e. width == -1)
the same as ASCII control characters (U+0001..U+001F), i.e. with a ctrl ca-
ret and its value XOR U+0040; treat their width as 2

fixes crash+cpu hog on 'meta-tab backspace'
2007-03-10 00:23:31 +00:00
tg 2edb96e663 add a 'true' at the end, to not start with an errorlevel >0 2007-03-04 06:20:48 +00:00
tg e0e432347b Minix 3 has no S_ISSOCK (probably not even UNIX® domain sockets)
and lacks other things (rlimit stuff), so it won't make it today
2007-03-04 05:14:10 +00:00
tg 17d0fd1e23 more NSIG 2007-03-04 05:04:54 +00:00
tg 95632ee53b better tr, better descr 2007-03-04 05:03:57 +00:00
tg 2e11e89d8b • _NSIG seems to be more standard than NSIG (non-POSIX)
• allow off-by-one (sigmax eq NSIG not NSIG-1)
2007-03-04 04:53:06 +00:00
tg 67ff737230 some tr(1) are more weird than others 2007-03-04 04:52:28 +00:00
tg 2cbd686fc4 cppflags for Minix 3 2007-03-04 04:45:36 +00:00
tg 0a20bb8dd4 • Minix 3 doesn't have <sys/mman.h>
• Some OSes might need <stdint.h> for int32_t (Minix 3 with GCC)
2007-03-04 04:36:45 +00:00
tg 0f291e9ff5 Support old versions of ash 2007-03-04 04:28:58 +00:00
tg 3844d3629e fix a warning 2007-03-04 03:48:50 +00:00
tg 5ee2937a9a sync 2007-03-04 03:47:37 +00:00
tg 83c2ee87f4 • remove strcasestr.c, use home-grown implementation¹, call it stricmp,
and have it return an API-correct const char *
• enhance and stylify comments
• a little KNF and simplifications
• #ifdef DEBUG: replace strchr and strstr with ucstrchr and ucstrstr
  that take and return a non-const char *, and fix the violations
• new cstrchr, cstrstr (take and give const char *)
• new vstrchr, vstrstr (take const or not, give boolean value)
• new afreechk(x) = afreechv(x,x) = if (x1) afree(x2, ATEMP)
• new ksh_isdash(str) = (str != NULL) && !strcmp(str, "-")
• replace the only use of strrchr with inlined code to shrink
• minor man page fixes
• Minix 3 signames are autogenerated with gcc
• rename strlfun.c to strlcpy.c since we don't do strlcat(3) anyway,
  only strlcpy(3), and shorten it
• dot.mkshrc: move MKSH=… down to the export line
  to not disturb the PS1 visual impression ☺
• dot.mkshrc: Lstripcom(): optimise
• bump version

¹) side effect from creating API-correct cstrchr, cstrstr, etc.
   uses goto so it must be better ☻

tested on mirbsd-current via both Makefile and Build.sh
2007-03-04 03:04:28 +00:00
tg 62b347a1b0 merge the const branch +- a few 2007-03-04 00:13:17 +00:00
tg 90af366ee0 sync 2007-03-03 21:48:33 +00:00
tg e31b852abc mirtoconf the checks if to use persistent history support 2007-03-03 21:36:08 +00:00
tg f6ff09ccbe don't have two functions token(), helps ctags 2007-03-03 21:12:51 +00:00
tg 67a28c4c3f typo, prevents compilation under Interix (has _sys_signame[] array) 2007-02-27 15:03:28 +00:00
tg 6485b06eed * From the Solaris tr(1) manual page:
o  Each input character found in the array  specified  by
           string1 is replaced by the character in the same rela-
           tive position in the array specified by string2.  When
           the array specified by string2 is shorter that the one
           specified by string1, the results are unspecified.
  So give tr <everythingbutalphanum> _ the appropriate number of underscores.
* Also strip dashes from header names.
2007-02-27 00:31:17 +00:00
tg e9d1b0fb7b /usr/ucb/tr chokes to freeze state on tr -d -c 2007-02-27 00:23:20 +00:00
tg e0e4c992fc • embed MKSH_ASSUME_UTF8 and MKSH_NEED_MKNOD in Build.sh
• have mksh with BSD makefiles always enable MKSH_ASSUME_UTF8
• sync BSD makefiles with Build.sh output
2007-02-18 16:24:13 +00:00
tg 6661a2b408 optimise away, this had not let me sleep; still the same output
shell quoting mystery ;)
2007-02-17 06:34:46 +00:00
tg 26adf9d62d fix superfluous spaces appearing twice at the line continuation
points and expanding to larger than 80c, major oops, cought on fwrt
2007-02-17 06:04:48 +00:00
tg ad05a2414b * edit.c: when tabcompleting a newline to backslash+newline, this
sequence is eaten before the command is called; cought by <TGEN>
  (Thomas E. Spanjaard) via IRC
  fix is to tabcomplete a newline to singlequote+newline+singlequote
* bump version
2007-02-16 17:46:42 +00:00
tg 1ac25b72dc add a note about the default $PATH 2007-02-13 13:36:18 +00:00
tg a207b0eda5 this doesn't need a shebang line, especially not one hardcoding /usr/bin/perl 2007-02-13 12:59:03 +00:00
tg ebaf8ed5b5 add CPPFLAGS for The HURD 2007-02-13 12:26:46 +00:00
tg a0fcdecb75 add new #ifdef MKSH_ASSUME_UTF8 which saves us from needing to
call setlocale() if we know the result will always be UTF-8
2007-02-10 21:59:15 +00:00
tg 665fba6dbf bump version 2007-02-07 02:31:06 +00:00
tg dd462f00d3 repair 'bind' builtin with no args output; damage taken in -r1.80 2007-02-07 02:01:43 +00:00