From 3389cab2f5693689281b6e9b19ed235553fbaa1e Mon Sep 17 00:00:00 2001 From: Johnothan King Date: Sat, 30 Jul 2022 15:11:20 -0700 Subject: [PATCH] Fix building on Haiku and fix some typos (#498) - Fixed a few minor typos and updated the list of tested systems in src/cmd/ksh93/README. - vmmopen.c: Include the ast.h header to fix a build error on Haiku caused by the otherwise undefined NoN macro (re: 05f0c1b1). --- NEWS | 6 +++--- src/cmd/ksh93/README | 5 +++-- src/cmd/ksh93/fun/man | 4 ++-- src/cmd/ksh93/sh/lex.c | 2 +- src/cmd/ksh93/sh/xec.c | 2 +- src/lib/libast/vmalloc/vmmopen.c | 1 + 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/NEWS b/NEWS index 873f5ac88..717de7fe5 100644 --- a/NEWS +++ b/NEWS @@ -93,7 +93,7 @@ Any uppercase BUG_* names are modernish shell bug IDs. For example, this now writes 'OK' to standard error: cat >&2 <(echo OK) - Fixed the detection of a syntax error in compound assignments to - associative arays. + associative arrays. 2022-07-02: @@ -1734,8 +1734,8 @@ Any uppercase BUG_* names are modernish shell bug IDs. - Four of the date formats accepted by 'printf %()T' have had their functionality altered to the common behavior of date(1): - '%k' and '%l' print the current hour with blank padding, the former - based on a 24-hour clock and the latter a twelve hour clock. These - are common extensions present on Linux and *BSD. + based on a 24-hour clock and the latter a 12-hour clock. These are + common extensions present on Linux and *BSD. - '%f' prints a date with the format string '%Y.%m.%d-%H:%M:%S' (BusyBox). - '%q' prints the quarter of the year (GNU). diff --git a/src/cmd/ksh93/README b/src/cmd/ksh93/README index 85e153b50..39dfdee6d 100644 --- a/src/cmd/ksh93/README +++ b/src/cmd/ksh93/README @@ -277,8 +277,10 @@ failures (crashes, and/or important functionality does not work). GNU/Linux: Ubuntu 18.04 on armv7l (32-bit) GNU/Linux: Ubuntu 20.04 on arm64 GNU/Linux: Void Linux (musl C library) on x86_64 +*** Haiku R1/beta3 on x86_64 *** HP-UX B.11.11 on pa-risc * illumos: OmniOS 2020-08-19 (gcc) on x86_64 + illumos: OmniOS r151040 (gcc) on x86_64 macOS 10.13.6 (High Sierra) on x86_64 macOS 10.14.6 (Mojave) on x86_64 * macOS 12.0.1 (Monterey) on arm64 @@ -293,8 +295,7 @@ failures (crashes, and/or important functionality does not work). *** Windows 7 using Cygwin on x86 *** Windows 10 using Cygwin on x86_64 *** Windows 11 using Cygwin on x86_64 -* Windows 11 using WSL 2 with Ubuntu 20.04 on x86_64 -*** Haiku R1/beta3 on x86_64 + Windows 11 using WSL 2 with Ubuntu 20.04 on x86_64 #### REPORTING BUGS #### diff --git a/src/cmd/ksh93/fun/man b/src/cmd/ksh93/fun/man index 3e8bb80fc..e590e4e3c 100755 --- a/src/cmd/ksh93/fun/man +++ b/src/cmd/ksh93/fun/man @@ -51,7 +51,7 @@ namespace man # Check for a built-in with --man, i.e., if: # - 'whence -t' says it is a built-in; # - it is not :, true, false, or echo; - # - the name or path we would excute appears in output of 'builtin'. + # - the name or path we would execute appears in output of 'builtin'. # This way, path-bound built-ins' --man is only used if found in $PATH. builtin_has_selfdoc() @@ -77,7 +77,7 @@ namespace man # codes even if standard error is not on a terminal. Note that, in # fact, all --man output is a glorified error message! Strange but # true. So to capture the output, we need to redirect standard error to - # standard ouput (2>&1). Also, 'test' and '[' need special invocations. + # standard output (2>&1). Also, 'test' and '[' need special invocations. # Also note: '--??man' is safer as some programs may override --man; # see any_builtin --??help (e.g., 'whence --??help') for more info. diff --git a/src/cmd/ksh93/sh/lex.c b/src/cmd/ksh93/sh/lex.c index 013c9646f..31e88d9f8 100644 --- a/src/cmd/ksh93/sh/lex.c +++ b/src/cmd/ksh93/sh/lex.c @@ -477,7 +477,7 @@ int sh_lex(Lex_t* lp) { if(lp->lex.intest) return(c); - /* '((' arithmetic comamnd */ + /* '((' arithmetic command */ lp->lexd.nest=1; lp->lastline = sh.inlineno; lp->lexd.lex_state = ST_NESTED; diff --git a/src/cmd/ksh93/sh/xec.c b/src/cmd/ksh93/sh/xec.c index 8ba78b57c..b24a17954 100644 --- a/src/cmd/ksh93/sh/xec.c +++ b/src/cmd/ksh93/sh/xec.c @@ -2119,7 +2119,7 @@ int sh_exec(register const Shnode_t *t, int flags) && tt->com.comio /* ...and one I/O redirection... */ && !tt->com.comio->ionxt /* ...but not more than one... */ && !(tt->com.comio->iofile & (IOPUT|IOAPP)) /* ...and not > or >> */ - && !sh_isoption(SH_POSIX)) /* not in POSIX compilance mode */ + && !sh_isoption(SH_POSIX)) /* not in POSIX compliance mode */ { iop = openstream(tt->com.comio,&savein); } diff --git a/src/lib/libast/vmalloc/vmmopen.c b/src/lib/libast/vmalloc/vmmopen.c index 169005dd6..d021dae3e 100644 --- a/src/lib/libast/vmalloc/vmmopen.c +++ b/src/lib/libast/vmalloc/vmmopen.c @@ -16,6 +16,7 @@ * * ***********************************************************************/ #include "FEATURE/vmalloc" +#include #if !_hdr_sys_shm NoN(vmmapopen)