2e4cd72899
make certain actions flush the history buffer
2015-07-05 19:53:46 +00:00
e0196f47d5
implement completely new multiline code by delaying history store
...
this commit is valgrind-tested
2015-07-05 19:37:18 +00:00
be8c2fa8c2
optimise by making use of commitid 1005529AD8D33CF99B9
2015-07-05 19:02:16 +00:00
48af854117
fix 'command -v' for "shell reserved words"
...
From: Martijn Dekker <martijn@inlv.org >
also adjust manpage accordingly
2015-07-05 17:50:40 +00:00
0d5b514e63
now removes *all* trailing newlines (by reusing histsave result, saves code),
...
plus plugs an ancient memory leak (hist_execute afree’s its arg now);
also partial revert of commitid 78014291f06497b3 as COMPLEX_HISTORY handles
multi-line commands correctly now (r1.4, 2005-05-23)
2015-07-05 17:04:26 +00:00
757d857319
greatly simplify hist_execute (useless to cut a string in twain, then
...
restore the very same string), except now, the one trailing newline
is not removed (except in histsave)
2015-07-05 16:48:28 +00:00
b87215bbaf
when storing commands with embedded newlines, don’t take those as end of string
...
(inspired fix from Debian #783978 ; bug in original pdksh COMPLEX_HISTORY code)
2015-07-05 16:47:28 +00:00
b9a8fdf905
implement cat thing for realpath and rename too: if flag, call external
2015-07-05 15:45:18 +00:00
b478d334d9
merge spelling stuff from oksh
2015-07-05 15:22:41 +00:00
69ec1002eb
add new expected-fail from POSIX <Pine.BSM.4.64L.1410241226350.12660@herc.mirbsd.org>
2015-07-05 15:12:04 +00:00
5eeeaab8cf
ensure at least two spaces of cell-to-cell horizontal padding in print_columns;
...
audit all callers of print_columns to always pass the exact maximum sizes
2015-07-05 14:58:33 +00:00
69eac312de
omit trailing whitespace for print_columns
2015-07-05 14:47:41 +00:00
62e27c3e07
simplify print_columns func argument: no need to return the first arg any more
2015-07-05 14:43:08 +00:00
bbf0558f6a
in print_columns, skip space padding for all last cells, not just
...
those in the last column, for jagged arrays
2015-07-05 14:33:21 +00:00
11a2f9d822
make $LINENO in PS1 equivalent to ! (bug spotted by carstenh in IRC)
2015-07-05 13:49:42 +00:00
7a1acedd4a
bump; nothing to merge from oksh, and nothing more from me today
2015-06-28 16:23:24 +00:00
0bdc395a81
permit read -N n (n ≠ -1) and read -t to return partial reads with $? == 1
...
issue spotted by carstenh, could have been a documentation ambiguity issue
(as -N was designed to read and return exactly n bytes), but this resolves
it in a way both backwards-compatible and user-pleasing
2015-06-28 14:57:25 +00:00
f03037706c
cd does weird things wrt. error messages; slightly better, from carstenh via IRC
2015-06-27 20:44:01 +00:00
01648d4495
scriptexec: cosmetic
2015-06-11 22:44:00 +09:00
df2cf83f8b
scriptexec: preserve original shell/interpreter path
...
For example,
When failing to execute the script which starts with the above line,
an error message does not contain information for /path/to/name.
Instead, it contains only name. In addition, if /path/to/dir/, an error
message contains empty string for a name of a failed script.
2015-06-11 22:16:17 +09:00
b27e10a32e
scriptexec: try to use shell/interpreter name as well on OS/2
...
If specified path does not exist, try to use shell/interpreter name
without directory.
On OS/2, directory structures of distribution is quite different. And
Some scripts have hard coded shell/interpreter. To overcome this, allow
to use shell/interpreter name if specified path does not exist.
2015-06-11 16:16:07 +09:00
25bb7dcec4
exec: fix that executing a file with multiple dots fails on OS/2
...
For example, [a.b.exe] cannot be executed with [a.b].
modified: exec.c
2015-06-11 16:10:29 +09:00
a041295dae
BEGINLIBPATH, ENDLIBPATH and LIBPATHSTRICT are not inhertied on OS/2
2015-06-03 15:27:32 +09:00
645b537439
Support BEGINLIBPATH, ENDLIBPATH and LIBPATHSTRICT on OS/2
2015-06-03 13:00:50 +09:00
011d0abf2c
Clean-up temporary files on OS/2
...
On OS/2, unlink() fails on opened files. For this case, try to unlink()
them at termination.
2015-06-03 13:00:49 +09:00
89324074c4
Prepend /@unixroot to rooted paths on OS/2
...
$UNIXROOT is a root directory of FHS on OS/2. /@unixroot is replaced by
$UNIXROOT at runtime.
2015-06-03 13:00:49 +09:00
0fbbbed49c
Support arrow keys on emacs/vi mode on OS/2
2015-06-03 13:00:49 +09:00
c8bdf4d149
Define MKSH_NOPROSPECTOFWORK on OS/2
...
Strangely, sometimes mksh is blocked when it is running in a background
console, that is, a window not having a focus.
2015-06-03 13:00:48 +09:00
d601372feb
Fix compilation warnings/errors when MKSH_NOPROSPECTOFWORK is defined
...
-----
jobs.c: In function `j_waitj':
jobs.c:1117: warning: unused variable `omask'
jobs.c: In function `j_sigchld':
jobs.c:1321: error: `sm_sigchld' undeclared (first use in this function)
jobs.c:1321: error: (Each undeclared identifier is reported only once
jobs.c:1321: error: for each function it appears in.)
-----
2015-06-03 13:00:48 +09:00
3af76d7f94
Check sh.exe on OS/2 intead of sh
2015-06-03 13:00:47 +09:00
29161973e3
Set stdin to text mode, and stdout/stderr to binary mode if not a console
2015-06-03 13:00:47 +09:00
8168ee626f
Disable some tests on OS/2
2015-06-03 13:00:46 +09:00
431f250762
Use ; as a path separator on OS/2 when testing
2015-06-03 13:00:46 +09:00
a1a8bd3f42
Define MKSH_UNEMPLOYED on OS/2
2015-06-03 13:00:46 +09:00
fc17d48a59
Consider an OS/2-style absolute path when testing
...
x:* and \* are absolute paths on OS/2 as well as /*.
2015-06-03 13:00:45 +09:00
4076b74ae8
Convert backslashes of PATH and TMPDIR to slashes on OS/2
...
PATH and TMPDIR are used by OS/2 as well. So they may have backslashes
as a directory separator. A backslash may cause an unexpected behavior
when do 'echo'. Because a backslash may be used as an escaped character.
2015-06-03 13:00:45 +09:00
ffb5e7cd19
Workaround for execve() on OS/2
2015-06-03 13:00:44 +09:00
a32d1d70bf
Support .cmd and .bat on OS/2
2015-06-03 13:00:44 +09:00
148c019595
MZ magic is supported on OS/2
2015-06-03 13:00:44 +09:00
07e5cadc54
Support a response file on OS/2
2015-06-03 13:00:43 +09:00
759b6ec59f
Consider OS/2-style path
...
OS/2 uses 'x:' as a drive prefix and '\' as a directory separator.
2015-06-03 13:00:43 +09:00
a03cf65602
Consider executable extensions in case of some test commands on OS/2
...
-r, -w, -x, -a, -e, -f.
2015-06-03 13:00:42 +09:00
fdd0831a58
Check EPERM as well on OS/2
...
fcntl() on OS/2 kLIBC may return EPERM instead of EBADF in this context.
2015-06-03 13:00:42 +09:00
9b30ce1a6d
Support extproc on OS/2
...
extproc is similar to like #! on OS/2.
2015-06-03 13:00:42 +09:00
5127457319
Read in text mode, write in binary mode on OS/2
...
This enables to convert CR+LF to LF when reading, but disables to
convert LF to CR+LF when writing.
Instead, however, CR+LF are not passed into mksh as is.
2015-06-03 13:00:41 +09:00
a3fdbc6802
Make all the files executable on OS/2
...
On OS/2, an executable status is determined by an extension such as .exe
not real executable mode.
Script files without executable extensions such as .exe, cannot be
executed.
2015-06-03 13:00:41 +09:00
5ed2481df2
Try to append executable suffixes if not having extension on OS/2
2015-06-03 13:00:40 +09:00
8f633da789
Path separator is ; on OS/2
2015-06-03 13:00:40 +09:00
c29f892437
Ignore size on OS/2
...
Size does not support OS/2 OMF executables.
-----
size mksh.exe
size: mksh.exe: File format not recognized
-----
2015-06-03 13:00:39 +09:00
fb22b94007
Executables have .exe extension on OS/2
2015-06-03 13:00:39 +09:00