platform_external_mksh/Android.patch.txt
Elliott Hughes 47086265c3 Upgrade to mksh R57.
R57 rolls up bugfixes, with few hard changes:

[gecko2] Update operating environment reporting for the Macintosh
[Martijn Dekker] make ${foo#'bar'} in here document behave like ksh93
[Martijn Dekker] quote empty strings for re-entry into shell
[tg, G.raud Meyer] Improve documentation, especially for tty states
[tg] Protect against entering line editing with bad saved tty state
[tg] Fix set -o allexport for arrays (which we apparently do)
[tg] Handle lseek(2) returning -1 as pointed out by Coverity Scan
[tg] Fix left-padding UTF-8 strings
[tg, G.raud Meyer] Fix using the “-m” flag on the command line
[tg] Update to UCD 11.0.0
[multiplexd] Fix a segfault using ^W during search in Vi mode
[tg] Fix an error message; add a test for controlling tty
[tg] Permit unsetting LINES and COLUMNS, for those who need it
[tg] Fix manpage bug (RedHat BZ#1612173)
[tg] Minor spelling cleanup
[tg] Unbreak high-bit7 (nōn-ASCII) heredoc separators (LP#1779179)
[tg] Allow dumping high-bit7-char-containing strings in DEBUG mode
[tg] Add some testcases for behaviour questions popped up in IRC
[tg] Trick a GCC warning, to make up for it ignoring lint(1) hints
[tg] Add O_MAYEXEC support for CLIP OS
[tg] Make dup-to-self with ksh-style fd≥3 closing work; catern via IRC
[tg] Add compat glue for newer GNU groff mdoc to the manpages
[tg] Trigger EXIT trap after single-command subshells (Debian #910276)
[tg] Document set -eo pipefail caveat (LP#1804504)
[tg] Fix MKSH_EARLY_LOCALE_TRACKING warning
[tg] Document that, when your Unix is broken, GIGO applies (LP#1817959)
[tg] Improve error message for inaccessible executables (LP#1817789)

Test: treehugger
Change-Id: Ib5447fc474e509698bd04cdf70ed14b54e84d27a
2019-03-26 12:38:33 -07:00

50 lines
1.2 KiB
Text

diff -ru mksh-R57/funcs.c src/funcs.c
--- mksh-R57/funcs.c 2018-10-20 14:04:55.000000000 -0700
+++ src/funcs.c 2019-03-26 12:05:23.976821773 -0700
@@ -103,7 +103,9 @@
{Tsgbreak, c_brkcont},
{T__builtin, c_builtin},
{Tbuiltin, c_builtin},
+#if !defined(__ANDROID__)
{Tbcat, c_cat},
+#endif
{Tcd, c_cd},
/* dash compatibility hack */
{"chdir", c_cd},
@@ -126,7 +128,9 @@
{"pwd", c_pwd},
{Tread, c_read},
{Tdsgreadonly, c_typeset},
+#if !defined(__ANDROID__)
{"!realpath", c_realpath},
+#endif
{"~rename", c_rename},
{"*=return", c_exitreturn},
{Tsgset, c_set},
@@ -160,8 +164,10 @@
{"~printf", c_printf},
#endif
#if HAVE_SELECT
+#if !defined(__ANDROID__)
{"sleep", c_sleep},
#endif
+#endif
#ifdef __MirBSD__
/* alias to "true" for historical reasons */
{"domainname", c_true},
diff -ru mksh-R57/main.c src/main.c
--- mksh-R57/main.c 2019-01-05 05:24:45.000000000 -0800
+++ src/main.c 2019-03-26 12:05:23.980821764 -0700
@@ -399,6 +399,12 @@
/* import environment */
init_environ();
+ /* override default PATH regardless of environment */
+#ifdef MKSH_DEFPATH_OVERRIDE
+ vp = global(TPATH);
+ setstr(vp, MKSH_DEFPATH_OVERRIDE, KSH_RETURN_ERROR);
+#endif
+
/* for security */
typeset(TinitIFS, 0, 0, 0, 0);