diff --git a/NEWS b/NEWS index 579625365f98..fabf034eb469 100644 --- a/NEWS +++ b/NEWS @@ -834,8 +834,8 @@ Any uppercase BUG_* names are modernish shell bug IDs. $RANDOM $LINENO -- Fixed two bugs that caused `unset .sh.lineno` to always produce a memory - fault and `(unset .sh.level)` to memory fault when run in nested +- Fixed two bugs that caused 'unset .sh.lineno' to always produce a memory + fault and '(unset .sh.level)' to memory fault when run in nested functions. 2020-06-18: @@ -880,7 +880,7 @@ Any uppercase BUG_* names are modernish shell bug IDs. 2020-06-13: - Fixed a timezone name determination bug on FreeBSD that caused the - output from `LC_ALL=C printf '%T' now` to print the wrong time zone name. + output from "LC_ALL=C printf '%T\n' now" to print the wrong time zone name. 2020-06-11: @@ -927,14 +927,14 @@ Any uppercase BUG_* names are modernish shell bug IDs. Emacs editing mode is bugged in ksh93u+ and ksh2020. Let's say you were to run the following commands after starting a fresh instance of ksh: - $ alias foo='true' + $ alias foo=true $ unalias foo If you type 'a' and then press the up arrow on your keyboard, - ksh will complete 'a' to `alias foo='true'` by doing a reverse + ksh will complete 'a' to 'alias foo=true' by doing a reverse search for the last command that starts with 'a'. Run the alias command again, then type 'u' and press the up - arrow key again. If ksh is in Vi mode, you will get `unalias foo`, - but in Emacs mode you will get `alias foo='true'` again. + arrow key again. If ksh is in Vi mode, you will get 'unalias foo', + but in Emacs mode you will get 'alias foo=true' again. All subsequent commands were ignored as ksh was saving the first command and only based later searches off of it. diff --git a/docs/ksh/builtins.html b/docs/ksh/builtins.html index 530d820489eb..da84a584f4af 100644 --- a/docs/ksh/builtins.html +++ b/docs/ksh/builtins.html @@ -93,7 +93,7 @@

Guidelines for writing ksh-93 It is best to set the value of the environment variable PACKAGE_ast to the pathname of the directory containing the development kit. -The include directory contains a sub-directory +The include directory contains a subdirectory named ast that contains interface prototypes for functions that you can call from built-ins. The lib directory contains the ast library diff --git a/src/cmd/INIT/RELEASE b/src/cmd/INIT/RELEASE index f877be003a67..12348db62b45 100644 --- a/src/cmd/INIT/RELEASE +++ b/src/cmd/INIT/RELEASE @@ -355,7 +355,7 @@ regress.sh: INPUT and OUTPUT handle -f for printf instead of print 04-06-11 package.sh: make sure $INSTALLROOT/bin is in front of $PATH package.sh: skip nmake if older than 2000-10-31 -04-05-20 package.sh: fix arg vs. package parse with - or '' to disambuguate +04-05-20 package.sh: fix arg vs. package parse with - or '' to disambiguate 04-05-11 package.sh: package verbose update lists closure for package setup package.sh: add src/lib/libardir to nmake proto bootstrap regress.sh: probe for rm -u vs. chmod -R u+rwx diff --git a/src/cmd/INIT/mamake.c b/src/cmd/INIT/mamake.c index 3c4c2f4b21be..4d31cf6e9ce1 100644 --- a/src/cmd/INIT/mamake.c +++ b/src/cmd/INIT/mamake.c @@ -386,7 +386,7 @@ buffer(void) if (buf = state.old) state.old = state.old->old; else if (!(buf = newof(0, Buf_t, 1, 0)) || !(buf->buf = newof(0, char, CHUNK, 0))) - report(3, "out of space [buffer]", NiL, (unsigned long)0); + report(3, "out of memory [buffer]", NiL, (unsigned long)0); buf->end = buf->buf + CHUNK; buf->nxt = buf->buf; return buf; @@ -418,7 +418,7 @@ appendn(Buf_t* buf, char* str, int n) i = buf->nxt - buf->buf; m = (((buf->end - buf->buf) + n + CHUNK + 1) / CHUNK) * CHUNK; if (!(buf->buf = newof(buf->buf, char, m, 0))) - report(3, "out of space [buffer resize]", NiL, (unsigned long)0); + report(3, "out of memory [buffer resize]", NiL, (unsigned long)0); buf->end = buf->buf + m; buf->nxt = buf->buf + i; } @@ -453,7 +453,7 @@ duplicate(char* s) n = strlen(s); if (!(t = newof(0, char, n, 1))) - report(3, "out of space [duplicate]", s, (unsigned long)0); + report(3, "out of memory [duplicate]", s, (unsigned long)0); strcpy(t, s); return t; } @@ -468,7 +468,7 @@ dictionary(void) Dict_t* dict; if (!(dict = newof(0, Dict_t, 1, 0))) - report(3, "out of space [dictionary]", NiL, (unsigned long)0); + report(3, "out of memory [dictionary]", NiL, (unsigned long)0); return dict; } @@ -542,7 +542,7 @@ search(register Dict_t* dict, char* name, void* value) else if (value) { if (!(root = newof(0, Dict_item_t, 1, strlen(name)))) - report(3, "out of space [dictionary]", name, (unsigned long)0); + report(3, "out of memory [dictionary]", name, (unsigned long)0); strcpy(root->name, name); } if (root) @@ -609,7 +609,7 @@ rule(char* name) if (!(r = (Rule_t*)search(state.rules, name, NiL))) { if (!(r = newof(0, Rule_t, 1, 0))) - report(3, "out of space [rule]", name, (unsigned long)0); + report(3, "out of memory [rule]", name, (unsigned long)0); r->name = (char*)search(state.rules, name, (void*)r); } return r; @@ -628,7 +628,7 @@ cons(Rule_t* r, Rule_t* p) if (!x) { if (!(x = newof(0, List_t, 1, 0))) - report(3, "out of space [list]", r->name, (unsigned long)0); + report(3, "out of memory [list]", r->name, (unsigned long)0); x->rule = p; x->next = r->prereqs; r->prereqs = x; @@ -712,7 +712,7 @@ view(void) } n = strlen(s); if (!(vp = newof(0, View_t, 1, strlen(p) + n + 1))) - report(3, "out of space [view]", s, (unsigned long)0); + report(3, "out of memory [view]", s, (unsigned long)0); vp->node = n + 1; strcpy(vp->dir, s); *(vp->dir + n) = '/'; diff --git a/src/cmd/INIT/mktest.sh b/src/cmd/INIT/mktest.sh index d694fc8f6cbe..d5b8ce90f655 100755 --- a/src/cmd/INIT/mktest.sh +++ b/src/cmd/INIT/mktest.sh @@ -83,7 +83,7 @@ unit.rt [ unit [ arg ... ] ] [+PROG \acommand\a [ \aarg\a ... ]]?Run \acommand\a with optional arguments.] [+TEST [ \anumber\a ]] [ \adescription\a ... ]]?Define a new - test group with optional \anumber\a and \adescripion\a.] + test group with optional \anumber\a and \adescription\a.] [+TWD [ \adir\a ... ]]?Set the temporary test dir to \adir\a. The default is \aunit\a\b.tmp\b, where \aunit\a is the test input file sans directory and suffix. If \adir\a matches \b/*\b diff --git a/src/cmd/INIT/ratz.c b/src/cmd/INIT/ratz.c index 0de42fc9c24d..f0003aa08ccd 100644 --- a/src/cmd/INIT/ratz.c +++ b/src/cmd/INIT/ratz.c @@ -1313,7 +1313,7 @@ typedef struct internal_state { gz_headerp gzhead; /* gzip header information to write */ uInt gzindex; /* where in extra, name, or comment */ Byte method; /* STORED (for zip only) or DEFLATED */ - int last_flush; /* value of flush param for previous deflate call */ + int last_flush; /* value of flush parameter for previous deflate call */ /* used by deflate.c: */ @@ -4939,7 +4939,7 @@ char** argv; while (block(stdin, gz, (char*)&header)) { /* - * last 2 blocks are NUL + * last 2 blocks are NULL */ if (!*header.name) diff --git a/src/cmd/INIT/regress.sh b/src/cmd/INIT/regress.sh index 3ef3e85a7faf..563b539a9674 100644 --- a/src/cmd/INIT/regress.sh +++ b/src/cmd/INIT/regress.sh @@ -173,7 +173,7 @@ unit [ command [ arg ... ] ] the next explicit \bSET\b.] [+TALLY?Called by \bregress\b display the \bTEST\b results.] [+TEST \b\anumber\a [ \adescription\a ... ]]?Define a new test - group labelled \anumber\a with optional \adescripion\a.] + group labelled \anumber\a with optional \adescription\a.] [+TITLE \b[+]] \atext\a?Set the \bTEST\b output title to \atext\a. If \b+\b is specified then \atext\a is appended to the default title. The default title is the test file base diff --git a/src/cmd/builtin/pty.c b/src/cmd/builtin/pty.c index 707889f989e3..152466f4196a 100644 --- a/src/cmd/builtin/pty.c +++ b/src/cmd/builtin/pty.c @@ -946,7 +946,7 @@ dialogue(Sfio_t* mp, Sfio_t* lp, int delay, int timeout) } if (*s && !(master->ignore = vmstrdup(vm, s))) { - error(ERROR_SYSTEM|2, "out of space"); + error(ERROR_SYSTEM|2, "out of memory"); goto done; } break; @@ -958,7 +958,7 @@ dialogue(Sfio_t* mp, Sfio_t* lp, int delay, int timeout) } if (*s && !(error_info.id = vmstrdup(vm, s))) { - error(ERROR_SYSTEM|2, "out of space"); + error(ERROR_SYSTEM|2, "out of memory"); goto done; } break; @@ -970,7 +970,7 @@ dialogue(Sfio_t* mp, Sfio_t* lp, int delay, int timeout) } if (*s && !(master->prompt = vmstrdup(vm, s))) { - error(ERROR_SYSTEM|2, "out of space"); + error(ERROR_SYSTEM|2, "out of memory"); goto done; } break; diff --git a/src/cmd/ksh93/COMPATIBILITY b/src/cmd/ksh93/COMPATIBILITY index 1d34d831d9de..403795ebc40f 100644 --- a/src/cmd/ksh93/COMPATIBILITY +++ b/src/cmd/ksh93/COMPATIBILITY @@ -236,7 +236,7 @@ omitted features that are completely upward compatible. the stty lnext character is set to control-v or is unset. The sequence escape control-v will display the shell version. -29. In ksh-88, DEBUG traps were executed. after each command. In ksh-93 +29. In ksh-88, DEBUG traps were executed after each command. In ksh-93 DEBUG traps are executed before each command. 30. In ksh-88, a redirection to a file name given by an empty string was diff --git a/src/cmd/ksh93/README b/src/cmd/ksh93/README index e84c8847a6ef..bcee382b2f67 100644 --- a/src/cmd/ksh93/README +++ b/src/cmd/ksh93/README @@ -117,7 +117,7 @@ and/or execute only script. Note, that ksh does not read the .profile or $ENV file when it the real and effective user/group id's are not equal. -The tests sub-directory contains a number of regression tests for ksh. +The tests subdirectory contains a number of regression tests for ksh. To run all these tests with the shell you just built, run the command bin/shtests For help and more options, type @@ -198,4 +198,3 @@ https://github.com/ksh93/ksh Originally written by: David Korn dgk@research.att.com - diff --git a/src/cmd/ksh93/RELEASE b/src/cmd/ksh93/RELEASE index cf91ff583952..ff9ce1b76805 100644 --- a/src/cmd/ksh93/RELEASE +++ b/src/cmd/ksh93/RELEASE @@ -56,9 +56,9 @@ could core dump has been fixed. 12-06-06 A bug in which unset of an associative array of compound variables did not completely unset the variable has been fixed. -12-06-06 A bug in which exporting left or right justified fields could loose +12-06-06 A bug in which exporting left or right justified fields could lose the field width has been fixed. -12-06-06 A bug on Solaris11 in which >; did not work for /dev/null was fixed. +12-06-06 A bug on Solaris 11 in which >; did not work for /dev/null was fixed. 12-06-05 A race condition which occurred when stopping a builtin command invoked from a subshell has been fixed. 12-06-05 A bug with appending elements to an empty indexed array has been @@ -99,7 +99,7 @@ 12-05-15 Fixed a .paths bug in which only the first BUILTIN_LIB assignment worked. 12-05-14 Arithmetic expressions and subexpressions that are not floating point now treat -0 as 0, so that $((-0)) is 0 and $((-0.0)) is -0. -12-05-11 'unset .sh' now fails with readonly message instead of coredump. +12-05-11 'unset .sh' now fails with a readonly message instead of a coredump. 12-05-11 A bug which left an associative array arr containing one element in the wrong state after expanding with ${arr[@]} has been fixed. 12-05-10 A bug in which typeset -f did not display options that called getopts @@ -163,9 +163,9 @@ 12-04-02 Made some namespace changes and added a regression test. 12-03-30 A bug with namespaces in which PATH and FPATH set in a namespace was not restored when leaving the namespace has been fixed. -12-03-29 A bug in which appending an index array onto an array without elements +12-03-29 A bug in which appending an indexed array onto an array without elements caused the first element to be 1 rather than 0 has been fixed. -12-03-29 A bug which could cause a core dump when copying a large index array +12-03-29 A bug which could cause a core dump when copying a large indexed array has been fixed. 12-03-28 The shell now generates an error message when the sizes with L, Z, and R are > 32767 on 32 bit binaries instead of generating a core dump. @@ -185,7 +185,7 @@ ref is a name reference to arr[i] has been fixed. 12-03-21 A bug in which assigning a compound variable into arr[i], where arr[i] is an array variable did not work correctly has been fixed. -12-03-21 A bug with multi-dimenstional index arrays in which ${arr[i][j]} +12-03-21 A bug with multidimensional indexed arrays in which ${arr[i][j]} could generate a bogus error message when i was > 9 has been fixed. 12-03-21 A bug in which typeset v=foo, typeset -p v[0] generated a core dump has been fixed. @@ -207,7 +207,7 @@ error since a is not an assignment command. 12-03-16 A bug in which an unset discipline from a variable defined in a subshell is not invoked in the subshell has been fixed. -12-03-08 The assignment typeset -a (x=1 y=2) now creates an index array +12-03-08 The assignment typeset -a (x=1 y=2) now creates an indexed array of two elements rather than an array of one element which is a compound variable. 12-03-02 +The vi and emacs edit modes now list all the entries in a directory @@ -353,7 +353,7 @@ jobs to complete has been fixed. 11-06-09 A bug which caused the options.sh regression test to fail on OS390 Linux has been fixed. The bug could also have affected other systems. -11-06-07 +A number of changes to support the still undocuments namespace option +11-06-07 +A number of changes to support the still undocumented namespace option have been added. 11-06-06 A bug in which command substitution of eval would hang when it had standard error redirected to standard output has been fixed. @@ -402,7 +402,7 @@ an a core dump for not fixed arrays. 11-04-25 A bug in the references to two dimensional compound arrays has been fixed. -11-04-20 A bug in which a name reference to a multidimentional index array +11-04-20 A bug in which a name reference to a multidimensional indexed array index, nameref x=foo[3][4], did not work correctly has been fixed. 11-04-18 Changes were added to allow fixed size arrays of variable sized objects when the SHOPT_FIXEDARRAY compile option defined on 10-09-28. @@ -538,7 +538,7 @@ 10-11-18 Fixed a bug in which typeset -T foo; typeset -T could cause a core dump. 10-11-17 Fixed a bug in which the error message for set -u could come out - garbelled. + garbled. 10-11-17 Modified the parser so that typeset -a var=(...) no longer checks the first index for aliases and reserved words. 10-11-17 A bug in which a subshell command consisted of only a for or until @@ -641,7 +641,7 @@ has been fixed. 10-09-08 A bug in the processing of references to multidimensional arrays in arithmetic expressions has been fixed. -10-09-08 A bug in the handling of multi-dimensional arrays which caused +10-09-08 A bug in the handling of multidimensional arrays which caused the number of elements in each dimension to be incorrect has been fixed. 10-09-07 The change for messages on 10-08-09 did not handle message in @@ -716,7 +716,7 @@ 10-07-09 A bug in the handling of process substitution inside command substitution as part of a pipeline has been fixed. 10-07-07 A bug in the output for compound variables containing - multi-dimensional arrays has been fixed. + multidimensional arrays has been fixed. 10-07-06 ksh now recovers from changes made by bash to the history file without losing history commands. 10-06-25 A bug in which a large here document containing command substitutions @@ -789,7 +789,7 @@ 10-05-19 <<< with an empty string no longer gives an error. 10-05-19 A bug in arithmetic evaluation when a name reference to an array instance was used has been fixed. -10-05-14 A bug in which the shell treats a valid index array assignment, +10-05-14 A bug in which the shell treats a valid indexed array assignment, typeset -a x=(foo (x=3;y=4) bar) as a syntax error has been fixed. 10-05-13 A bug in creating name references to associative array variable after a lookup of one of its elements has been fixed. @@ -996,7 +996,7 @@ 09-09-09 A bug in which a subshell containing a background process could block until the background process completed has been fixed. 09-09-04 A bug in handling ${var[sub]}, where var is a nameref has been fixed. -09-09-03 A bug which caused an index array to have the wrong number of elements +09-09-03 A bug which caused an indexed array to have the wrong number of elements when it was converted from a compound variable by adding an another element has been fixed. 09-09-03 Specifying export for a compound variable now generates an error. @@ -1270,7 +1270,7 @@ 08-09-10 The shell now prints an error message when the type name specified for an indexed array subscript is not an enumeration type. 08-09-10 A bug in which a subshell that spawned a background process could - loose output that was produced after the foreground completed + lose output that was produced after the foreground completed has been fixed. 08-09-10 A timing bug on some systems that could cause coprocesses started by a subshell to not clean up and prevent other coprocesses has been fixed. @@ -1335,7 +1335,7 @@ jobs completed has been fixed. 08-06-23 _KSH_VERSION added as a name reference to .sh.version. 08-06-20 type now outputs 'special builtin' for special builtins. -08-06-19 A couple of bugs in multi-dimensional arrays have been fixed. +08-06-19 A couple of bugs in multidimensional arrays have been fixed. 08-06-19 A bug in which a syntax error in a dot script could generate a syntax error in the next subsequent command has been fixed. 08-06-17 Reduced the maximum function call depth to 2048 to avoid exceptions @@ -1496,7 +1496,7 @@ 07-10-03 A bug in which : was not allowed as part of an alias name has been fixed. 07-09-26 A bug in which appending a compound variable to a compound variable - or to an index array didn't work has been fixed. + or to an indexed array didn't work has been fixed. 07-09-19 In both emacs and vi edit mode, the escape sequence \E[A (usually cursor up, when the cursor is at the end of the line will fetch the most recent line starting with the current line. @@ -1543,7 +1543,7 @@ returned by a process that catches the SIGCONT signal is stopped and then continued. 07-12-13 A race condition in which a program that has been stopped and then - continued could loose the exit status has been fixed. + continued could lose its exit status has been fixed. 07-12-12 Code to check for file system out of space write errors for all writes has been added. 07-12-11 A bug in the macro expander for multibyte characters in which @@ -1574,7 +1574,7 @@ signs of { -NaN -Inf -0.0 } have been fixed. 07-11-15 +The full { SIGRTMIN SIGRTMIN+1 ... SIGRTMAX-1 SIGRTMAX } range of signals, determined at runtime, are now supported. -07-11-15 A bug in which creating an index array with only subscript 0 created +07-11-15 A bug in which creating an indexed array with only subscript 0 created only a simple variable has been fixed. 07-11-14 A bug in which appending to an indexed array using the form name+=([sub]=value) could cause the array to become an associative @@ -1853,7 +1853,7 @@ 05-08-31 +In the case that IFS contains to adjacent new-lines so that new-line is not treated as a space delimiter, only a single new-line is deleted at the end of a command substitution. -05-08-19 +When a tilde substitution expands to the / directory and is +05-08-19 +When a tilde expansion expands to the / directory and is followed by a /, it is replaced by the empty string. 05-08-16 A bug in which n<&m did not synchronize m has been fixed. 05-08-16 A bug in which process substitution ( <() and >() ) was not @@ -2168,7 +2168,7 @@ displays the function name followed by a comment containing the line number and the path name for the file that defined this function. 03-02-28 A bug in which the value of $LINENO was not correct when executing - command contained inside mult-line command substitutions has been + command contained inside multi-line command substitutions has been fixed. 03-02-19 +Since some existing ksh88 scripts use the undocumented and unintended ability to insert a : in front of the % and # parameter @@ -2889,7 +2889,7 @@ 96-07-31 The error message for ksh -o unknown was incorrect. 96-07-31 Functions invoked as name=value name, did not use values from the calling scope when evaluating value. -96-07-31 A bug in which the shell would reexecute previously +96-07-31 A bug in which the shell would re-execute previously executed code when a shell script or coprocess was run in the background has been fixed. 96-07-31 A bug in which an empty here-document would leave diff --git a/src/cmd/ksh93/RELEASE93 b/src/cmd/ksh93/RELEASE93 index 8005882f8e24..049d0d9f0fb5 100644 --- a/src/cmd/ksh93/RELEASE93 +++ b/src/cmd/ksh93/RELEASE93 @@ -265,7 +265,7 @@ of ksh. r. The error message for ksh -o unknown was incorrect. s. Functions invoked as name=value name, did not use values from the calling scope when evaluating value. - t. A bug in which the shell would reexecute previously + t. A bug in which the shell would re-execute previously executed code when a shell script or coprocess was run in the background has been fixed. u. A bug in which an empty here-document would leave @@ -452,4 +452,3 @@ of ksh. 18. Incompatibilities with 12/28/93 version. None intentional. - diff --git a/src/cmd/ksh93/bltins/alarm.c b/src/cmd/ksh93/bltins/alarm.c index 0b8b11777628..7392e8d5b26c 100644 --- a/src/cmd/ksh93/bltins/alarm.c +++ b/src/cmd/ksh93/bltins/alarm.c @@ -282,4 +282,3 @@ int b_alarm(int argc,char *argv[],Shbltin_t *context) nv_putval(np, argv[1], 0); return(0); } - diff --git a/src/cmd/ksh93/bltins/cd_pwd.c b/src/cmd/ksh93/bltins/cd_pwd.c index 881c04f9e869..805e52fbfe8c 100644 --- a/src/cmd/ksh93/bltins/cd_pwd.c +++ b/src/cmd/ksh93/bltins/cd_pwd.c @@ -254,4 +254,3 @@ int b_pwd(int argc, char *argv[],Shbltin_t *context) sfputr(sfstdout,cp,'\n'); return(0); } - diff --git a/src/cmd/ksh93/bltins/cflow.c b/src/cmd/ksh93/bltins/cflow.c index 34a3e0f6efd7..cec748e8bcb6 100644 --- a/src/cmd/ksh93/bltins/cflow.c +++ b/src/cmd/ksh93/bltins/cflow.c @@ -117,4 +117,3 @@ int b_break(register int n, register char *argv[],Shbltin_t *context) } return(0); } - diff --git a/src/cmd/ksh93/bltins/getopts.c b/src/cmd/ksh93/bltins/getopts.c index 46e4797363f9..fd810b637e85 100644 --- a/src/cmd/ksh93/bltins/getopts.c +++ b/src/cmd/ksh93/bltins/getopts.c @@ -19,7 +19,7 @@ ***********************************************************************/ #pragma prototyped /* - * getopts optstring name [arg...] + * getopts [-a name] optstring name [args...] * * David Korn * AT&T Labs @@ -200,4 +200,3 @@ int b_getopts(int argc,char *argv[],Shbltin_t *context) opt_info.disc = 0; return(r); } - diff --git a/src/cmd/ksh93/bltins/hist.c b/src/cmd/ksh93/bltins/hist.c index 66a0336e2850..b3ba037206d2 100644 --- a/src/cmd/ksh93/bltins/hist.c +++ b/src/cmd/ksh93/bltins/hist.c @@ -287,4 +287,3 @@ static void hist_subst(const char *command,int fd,char *replace) *(newp-1) = '='; sh_eval(sfopen(NIL(Sfio_t*),sp,"s"),1); } - diff --git a/src/cmd/ksh93/bltins/misc.c b/src/cmd/ksh93/bltins/misc.c index 57390f5a9c70..30166da9ea29 100644 --- a/src/cmd/ksh93/bltins/misc.c +++ b/src/cmd/ksh93/bltins/misc.c @@ -19,15 +19,20 @@ ***********************************************************************/ #pragma prototyped /* - * exec [arg...] + * bg [job...] + * disown [job...] + * exec [-c] [-a name] [command [arg ...]] * eval [arg...] + * fg [job...] * jobs [-lnp] [job...] - * login [arg...] * let expr... + * redirect [redirection...] + * source file [arg...] * . file [arg...] * :, true, false * wait [job...] * shift [n] + * times * * David Korn * AT&T Labs @@ -322,7 +327,7 @@ int b_dot_cmd(register int n,char *argv[],Shbltin_t *context) } /* - * null, true command + * null, true command */ int b_true(int argc,register char *argv[],Shbltin_t *context) { @@ -333,7 +338,7 @@ int b_true(int argc,register char *argv[],Shbltin_t *context) } /* - * false command + * false command */ int b_false(int argc,register char *argv[], Shbltin_t *context) { @@ -571,4 +576,3 @@ int b_universe(int argc, char *argv[],Shbltin_t *context) return(0); } #endif /* cmd_universe */ - diff --git a/src/cmd/ksh93/bltins/print.c b/src/cmd/ksh93/bltins/print.c index 814f9fb8f170..dcee9c54cc54 100644 --- a/src/cmd/ksh93/bltins/print.c +++ b/src/cmd/ksh93/bltins/print.c @@ -20,8 +20,8 @@ #pragma prototyped /* * echo [arg...] - * print [-nrps] [-f format] [-u filenum] [arg...] - * printf format [arg...] + * print [-enprsvC] [-f format] [-u fd] [string ...] + * printf format [string ...] * * David Korn * AT&T Labs @@ -1018,7 +1018,7 @@ static int extend(Sfio_t* sp, void* v, Sffmt_t* fe) /* * construct System V echo string out of * If there are not escape sequences, returns -1 - * Otherwise, puts null terminated result on stack, but doesn't freeze it + * Otherwise, puts null-terminated result on stack, but doesn't freeze it * returns length of output. */ diff --git a/src/cmd/ksh93/bltins/read.c b/src/cmd/ksh93/bltins/read.c index a65ac2d9de00..b4f143d6663f 100644 --- a/src/cmd/ksh93/bltins/read.c +++ b/src/cmd/ksh93/bltins/read.c @@ -19,7 +19,7 @@ ***********************************************************************/ #pragma prototyped /* - * read [-ACprs] [-d delim] [-u filenum] [-t timeout] [-n n] [-N n] [name...] + * read [-ACprsSv] [-d delim] [-u fd] [-t timeout] [-n count] [-N count] [var?prompt] [var ...] * * David Korn * AT&T Labs @@ -201,7 +201,7 @@ static void timedout(void *handle) * is an array of variable names * is the file descriptor * is union of -A, -r, -s, and contains delimiter if not '\n' - * is number of milli-seconds until timeout + * is the number of milliseconds until timeout */ int sh_readline(register Shell_t *shp,char **names, volatile int fd, int flags,ssize_t size,long timeout) @@ -563,7 +563,7 @@ int sh_readline(register Shell_t *shp,char **names, volatile int fd, int flags,s else c = 0; continue; -#endif /*SHOPT_MULTIBYTE */ +#endif /* SHOPT_MULTIBYTE */ case S_QUOTE: c = shp->ifstable[*cp++]; if(inquote && c==S_QUOTE) @@ -828,4 +828,3 @@ int sh_readline(register Shell_t *shp,char **names, volatile int fd, int flags,s siglongjmp(*shp->jmplist,jmpval); return(jmpval); } - diff --git a/src/cmd/ksh93/bltins/regress.c b/src/cmd/ksh93/bltins/regress.c index 1a4d15e5e67d..de8b3347aaa4 100644 --- a/src/cmd/ksh93/bltins/regress.c +++ b/src/cmd/ksh93/bltins/regress.c @@ -20,7 +20,7 @@ #pragma prototyped /* * regression test intercept control - * enable with SHOPT_REGRESS==1 in Makefile + * enable with 'SHOPT REGRESS=1' in src/cmd/ksh93/SHOPT.sh * not for production use * see --man for details * all string constants inline here instead of in data/... @@ -83,7 +83,7 @@ static const char usage[] = "trace line info is either \beuid==ruid\b or \beuid!=ruid\b. The " "intercepts are:]#?[original-euid:=1]" "{" - "[+geteuid()?The intercept effecive uid is returned. The " + "[+geteuid()?The intercept effective uid is returned. The " "\bsetuid\b() intercept may change this between the real uid and " "\aoriginal-euid\a.]" "[+setuid(uid)?Sets the intercept effective uid to \auid\a. " diff --git a/src/cmd/ksh93/bltins/sleep.c b/src/cmd/ksh93/bltins/sleep.c index 4e128f9fb28f..63d2c26234bd 100644 --- a/src/cmd/ksh93/bltins/sleep.c +++ b/src/cmd/ksh93/bltins/sleep.c @@ -19,7 +19,7 @@ ***********************************************************************/ #pragma prototyped /* - * sleep delay + * sleep [-s] duration * * David Korn * AT&T Labs diff --git a/src/cmd/ksh93/bltins/test.c b/src/cmd/ksh93/bltins/test.c index ba62478f8b76..98b2ca878310 100644 --- a/src/cmd/ksh93/bltins/test.c +++ b/src/cmd/ksh93/bltins/test.c @@ -151,8 +151,8 @@ int b_test(int argc, char *argv[],Shbltin_t *context) cp = argv[1]; if(c_eq(cp,'(') && argc<=6 && c_eq(argv[argc-1],')')) { - /* special case ( binop ) to conform with standard */ - if(!(argc==4 && (not=sh_lookup(cp=argv[2],shtab_testops)))) + /* special case ( binop ) to conform with standard */ + if(!(argc==4 && (not=sh_lookup(cp=argv[2],shtab_testops)))) { cp = (++argv)[1]; argc -= 2; @@ -490,7 +490,7 @@ int test_unop(Shell_t *shp,register int op,register const char *arg) static char a[3] = "-?"; a[1]= op; errormsg(SH_DICT,ERROR_exit(2),e_badop,a); - /* NOTREACHED */ + /* NOTREACHED */ return(0); } } diff --git a/src/cmd/ksh93/bltins/trap.c b/src/cmd/ksh93/bltins/trap.c index 26f470929e5c..c54be8ad287e 100644 --- a/src/cmd/ksh93/bltins/trap.c +++ b/src/cmd/ksh93/bltins/trap.c @@ -20,8 +20,10 @@ #pragma prototyped /* * trap [-p] action sig... - * kill [-l] [sig...] - * kill [-s sig] pid... + * kill [-lL] [sig...] + * kill [-n signum] [-s signame] pid... + * stop job... + * suspend * * David Korn * AT&T Labs diff --git a/src/cmd/ksh93/bltins/typeset.c b/src/cmd/ksh93/bltins/typeset.c index 223293478e29..62774104f9b1 100644 --- a/src/cmd/ksh93/bltins/typeset.c +++ b/src/cmd/ksh93/bltins/typeset.c @@ -21,11 +21,17 @@ /* * export [-p] [arg...] * readonly [-p] [arg...] - * typeset [options] [arg...] + * typeset [options] [arg...] + * autoload [options] [arg...] + * compound [options] [arg...] + * float [options] [arg...] + * functions [options] [arg...] + * integer [options] [arg...] + * nameref [options] [arg...] * alias [-ptx] [arg...] - * unalias [arg...] + * unalias [-a] [arg...] * hash [-r] [utility...] - * builtin [-sd] [-f file] [name...] + * builtin [-dls] [-f file] [name...] * set [options] [name...] * unset [-fnv] [name...] * @@ -363,7 +369,7 @@ int b_typeset(int argc,register char *argv[],Shbltin_t *context) case 'h': tdata.help = opt_info.arg; break; -#endif /*SHOPT_TYPEDEF*/ +#endif /* SHOPT_TYPEDEF */ case 's': if(!isfloat) { @@ -706,7 +712,7 @@ static int setall(char **argv,register int flag,Dt_t *troot,struct tdata *tp ap->nelem--; } else if(iarray && ap && ap->fun) - errormsg(SH_DICT,ERROR_exit(1),"cannot change associative array %s to index array",nv_name(np)); + errormsg(SH_DICT,ERROR_exit(1),"cannot change associative array %s to indexed array",nv_name(np)); else if( (iarray||(flag&NV_ARRAY)) && nv_isvtree(np) && !nv_type(np)) _nv_unset(np,NV_EXPORT); if(tp->pflag) @@ -1169,7 +1175,7 @@ int b_set(int argc,register char *argv[],Shbltin_t *context) sh_offstate(SH_VERBOSE); } else - /*scan name chain and print*/ + /* scan name chain and print */ print_scan(sfstdout,0,tdata.sh->var_tree,0,&tdata); return(0); } @@ -1574,4 +1580,3 @@ static void pushname(Namval_t *np,void *data) struct tdata *tp = (struct tdata*)data; *tp->argnam++ = nv_name(np); } - diff --git a/src/cmd/ksh93/bltins/ulimit.c b/src/cmd/ksh93/bltins/ulimit.c index c537a8100f4e..b0bae2f79851 100644 --- a/src/cmd/ksh93/bltins/ulimit.c +++ b/src/cmd/ksh93/bltins/ulimit.c @@ -19,7 +19,7 @@ ***********************************************************************/ #pragma prototyped /* - * ulimit [-HSacdfmnstuv] [limit] + * ulimit [-HSaMctdfxlqenupmrbiswTv] [limit] * * David Korn * AT&T Labs diff --git a/src/cmd/ksh93/bltins/umask.c b/src/cmd/ksh93/bltins/umask.c index 19978ac6b4cb..e9d6b5a59f03 100644 --- a/src/cmd/ksh93/bltins/umask.c +++ b/src/cmd/ksh93/bltins/umask.c @@ -95,4 +95,3 @@ int b_umask(int argc,char *argv[],Shbltin_t *context) } return(0); } - diff --git a/src/cmd/ksh93/bltins/whence.c b/src/cmd/ksh93/bltins/whence.c index 600633a9773d..dba52ac30e3d 100644 --- a/src/cmd/ksh93/bltins/whence.c +++ b/src/cmd/ksh93/bltins/whence.c @@ -20,7 +20,7 @@ #pragma prototyped /* * command [-pvVx] name [arg...] - * whence [-afvp] name... + * whence [-afpqv] name... * * David Korn * AT&T Labs @@ -311,4 +311,3 @@ static int whence(Shell_t *shp,char **argv, register int flags) } return(ret); } - diff --git a/src/cmd/ksh93/builtins.mm b/src/cmd/ksh93/builtins.mm index 0e4bae45d547..3aa54b8f12f5 100644 --- a/src/cmd/ksh93/builtins.mm +++ b/src/cmd/ksh93/builtins.mm @@ -79,7 +79,7 @@ It is best to set the value of the environment variable \f5PACKAGE_ast\fP to the pathname of the directory containing the development kit. -The \f5include\fP directory contains a sub-directory +The \f5include\fP directory contains a subdirectory named \f5ast\fP that contains interface prototypes for functions that you can call from built-ins. The \f5lib\fP directory contains the \f5ast\fP library diff --git a/src/cmd/ksh93/data/builtins.c b/src/cmd/ksh93/data/builtins.c index 3a48bcb5c61e..d3ddf575402a 100644 --- a/src/cmd/ksh93/data/builtins.c +++ b/src/cmd/ksh93/data/builtins.c @@ -291,7 +291,7 @@ const char sh_set[] = "[C?Prevents existing regular files from being overwritten using the \b>\b " "redirection operator. The \b>|\b redirection overrides this " "\bnoclobber\b option.]" -"[G?Causes \b**\b by itself to also match all sub-directories during pathname " +"[G?Causes \b**\b by itself to also match all subdirectories during pathname " "expansion.]" #if SHOPT_HISTEXPAND "[H?Enable \b!\b-style history expansion similar to \bcsh\b.]" @@ -961,12 +961,12 @@ const char sh_opthist[] = "maintains the ordering.]" "[+?When commands are edited (when the \b-l\b option is not specified), the " "resulting lines will be entered at the end of the history list and " - "then reexecuted by the current shell. The \b\f?\f\b command that " + "then re-executed by the current shell. The \b\f?\f\b command that " "caused the editing will not be entered into the history list. If the " "editor returns a non-zero exit status, this will suppress the " - "entry into the history list and the command reexecution. Command " + "entry into the history list and the command re-execution. Command " "line variable assignments and redirections affect both the \f?\f " - "command and the commands that are reexecuted.]" + "command and the commands that are re-executed.]" "[+?\afirst\a and \alast\a define the range of commands. \afirst\a and " "\alast\a can be one of the following:]{" "[+\anumber\a?A positive number representing a command " @@ -990,7 +990,7 @@ const char sh_opthist[] = "[e]:[editor?\aeditor\a specifies the editor to use to edit the history " "command. A value of \b-\b for \aeditor\a is equivalent to " "specifying the \b-s\b option.]" -"[l?List the commands rather than editing and reexecuting them.]" +"[l?List the commands rather than editing and re-executing them.]" "[N]#[num?Start at \anum\a commands back.]" "[n?Suppress the command numbers when the commands are listed.]" #if SHOPT_HISTEXPAND @@ -998,16 +998,16 @@ const char sh_opthist[] = "output. All other options are ignored.]" #endif "[r?Reverse the order of the commands.]" -"[s?Reexecute the command without invoking an editor. In this case " +"[s?Re-execute the command without invoking an editor. In this case " "an operand of the form \aold\a\b=\b\anew\a can be specified " "to change the first occurrence of the string \aold\a in the " - "command to \anew\a before reexecuting the command.]" + "command to \anew\a before re-executing the command.]" "\n" "\n[first [last] ]\n" "\n" -"[+EXIT STATUS?If a command is reexecuted, the exit status is that of " - "the command that gets reexecuted. Otherwise, it is one of the " +"[+EXIT STATUS?If a command is re-executed, the exit status is that of " + "the command that gets re-executed. Otherwise, it is one of the " "following:]{" "[+0?Successfully completion of the listing.]" "[+>0?An error occurred.]" @@ -1221,6 +1221,8 @@ const char sh_optprintf[] = "formats the output for use as a URI.]" "[+%P?Treat \astring\a as an extended regular expression and " "convert it to a shell pattern.]" + "[+%p?Convert number to hexadecimal.]" + "[+%Q?Convert number of seconds to readable time.]" "[+%R?Treat \astring\a as an shell pattern expression and " "convert it to an extended regular expression.]" "[+%T?Treat \astring\a as a date/time string and format it. The " @@ -1237,8 +1239,8 @@ const char sh_optprintf[] = "[+d?day of month number]" "[+D?date as \amm/dd/yy\a]" "[+e?blank padded day of month number]" - "[+f?print a date with the format '\%Y.\%m.\%d-\%H:\%M:\%S']" - "[+F?%ISO 8601:2000 standard date format; equivalent to Y-%m-%d]" + "[+f?print a date with the format \b%Y.%m.%d-%H:%M:%S\b]" + "[+F?ISO 8601:2000 standard date format; equivalent to \b%Y-%m-%d\b]" "[+g?\bls\b(1) \b-l\b recent date with \ahh:mm\a]" "[+G?\bls\b(1) \b-l\b distant date with \ayyyy\a]" "[+h?abbreviated month name]" @@ -1256,9 +1258,10 @@ const char sh_optprintf[] = "[+n?newline character]" "[+N?nanoseconds 000000000-999999999]" "[+p?meridian (e.g., \bAM\b or \bPM\b)]" + "[+P?lowercase meridian (e.g., \bam\b or \bpm\b)]" "[+q?quarter of the year]" "[+Q?\arecentdistant\a: \a\a is a unique " - "delimter character; \arecent\a format for recent " + "delimiter character; \arecent\a format for recent " "dates, \adistant\a format otherwise]" "[+r?12-hour time as \ahh:mm:ss meridian\a]" "[+R?24-hour time as \ahh:mm\a]" diff --git a/src/cmd/ksh93/data/limits.c b/src/cmd/ksh93/data/limits.c index 154392171500..e2e1d8cb8e55 100644 --- a/src/cmd/ksh93/data/limits.c +++ b/src/cmd/ksh93/data/limits.c @@ -49,7 +49,7 @@ const Limit_t shtab_limits[] = "nproc", "number of processes", RLIMIT_NPROC, "CHILD_MAX", 'u', LIM_COUNT, "pipe", "pipe buffer size", RLIMIT_PIPE, "PIPE_BUF", 'p', LIM_BYTE, "rss", "max memory size", RLIMIT_RSS, 0, 'm', LIM_KBYTE, -"rtprio", "max real time priority",RLIMIT_RTPRIO, 0, 'r', LIM_COUNT, +"rtprio", "max real-time priority",RLIMIT_RTPRIO, 0, 'r', LIM_COUNT, "sbsize", "socket buffer size", RLIMIT_SBSIZE, "PIPE_BUF", 'b', LIM_BYTE, "sigpend", "signal queue size", RLIMIT_SIGPENDING,"SIGQUEUE_MAX",'i', LIM_COUNT, "stack", "stack size", RLIMIT_STACK, 0, 's', LIM_KBYTE, diff --git a/src/cmd/ksh93/data/testops.c b/src/cmd/ksh93/data/testops.c index 32e39d1ad98c..eb8387d521cd 100644 --- a/src/cmd/ksh93/data/testops.c +++ b/src/cmd/ksh93/data/testops.c @@ -20,7 +20,7 @@ #pragma prototyped /* - * tables for the test builin [[...]] and [...] + * tables for the test builtin [[...]] and [...] */ #include diff --git a/src/cmd/ksh93/edit/edit.c b/src/cmd/ksh93/edit/edit.c index 566dc41ee296..d25638dc1628 100644 --- a/src/cmd/ksh93/edit/edit.c +++ b/src/cmd/ksh93/edit/edit.c @@ -1192,7 +1192,7 @@ void ed_putchar(register Edit_t *ep,register int c) #if SHOPT_ESH || SHOPT_VSH /* * returns the line and column corresponding to offset in the physical buffer - * if is non-zero and <= , then correspodning will start the search + * if is non-zero and <= , then corresponding will start the search */ Edpos_t ed_curpos(Edit_t *ep,genchar *phys, int off, int cur, Edpos_t curpos) { diff --git a/src/cmd/ksh93/edit/emacs.c b/src/cmd/ksh93/edit/emacs.c index 1ce233d7ba3d..6f31527f3f7f 100644 --- a/src/cmd/ksh93/edit/emacs.c +++ b/src/cmd/ksh93/edit/emacs.c @@ -101,7 +101,7 @@ One line screen editor for any program # define print(c) isprint(c) # define isword(c) (isalnum(out[c]) || (out[c]=='_')) # define digit(c) isdigit(c) -#endif /*SHOPT_MULTIBYTE */ +#endif /* SHOPT_MULTIBYTE */ typedef struct _emacs_ { @@ -1461,11 +1461,11 @@ static void draw(register Emacs_t *ep,Draw_t option) drawbuff[cur+1]=0; # if SHOPT_MULTIBYTE ed_external(drawbuff,(char*)drawbuff); -# endif /*SHOPT_MULTIBYTE */ +# endif /* SHOPT_MULTIBYTE */ n = ed_histgen(ep->ed,(char*)drawbuff); # if SHOPT_MULTIBYTE ed_internal((char*)drawbuff,drawbuff); -# endif /*SHOPT_MULTIBYTE */ +# endif /* SHOPT_MULTIBYTE */ if(ep->ed->hlist) { ed_histlist(ep->ed,n); diff --git a/src/cmd/ksh93/edit/history.c b/src/cmd/ksh93/edit/history.c index d7ae71e503ec..aca857acd922 100644 --- a/src/cmd/ksh93/edit/history.c +++ b/src/cmd/ksh93/edit/history.c @@ -200,7 +200,7 @@ static int sh_checkaudit(History_t *hp, const char *name, char *logbuf, size_t l return(r); } -#endif /*SHOPT_AUDIT*/ +#endif /* SHOPT_AUDIT */ static const unsigned char hist_stamp[2] = { HIST_UNDO, HIST_VERSION }; static const Sfdisc_t hist_disc = { NULL, hist_write, NULL, hist_exceptf, NULL}; diff --git a/src/cmd/ksh93/edit/vi.c b/src/cmd/ksh93/edit/vi.c index 16d0f6978026..8196ffca047c 100644 --- a/src/cmd/ksh93/edit/vi.c +++ b/src/cmd/ksh93/edit/vi.c @@ -297,7 +297,7 @@ int ed_viread(void *context, int fd, register char *shbuf, int nchar, int reedit /*** ESC was typed as first char of line ***/ esc_or_hang = 1; term_char = ESC; - shbuf[i--] = '\0'; /* null terminate line */ + shbuf[i--] = '\0'; /* null-terminate line */ } else if( i<0 || c==usreof ) { @@ -321,12 +321,12 @@ int ed_viread(void *context, int fd, register char *shbuf, int nchar, int reedit #endif if( term_char=='\n' || term_char==usreof ) { - /*** remove terminator & null terminate ***/ + /*** remove terminator & null-terminate ***/ shbuf[i--] = '\0'; } else { - /** terminator was ESC, which is not xmitted **/ + /** terminator was ESC, which is not emitted **/ term_char = ESC; shbuf[i+1] = '\0'; } @@ -933,7 +933,7 @@ static int cntlmode(Vi_t *vp) cur_virt = 0; vi_redraw((void*)vp); } -#endif /*SHOPT_EDPREDICT */ +#endif /* SHOPT_EDPREDICT */ break; @@ -2265,7 +2265,7 @@ static int search(register Vi_t* vp,register int mode) first_virt = 1; getline(vp,SEARCH); first_virt = 0; - virtual[last_virt + 1] = '\0'; /*** make null terminated ***/ + virtual[last_virt + 1] = '\0'; /*** make null-terminated ***/ vp->direction = mode=='/' ? -1 : 1; } diff --git a/src/cmd/ksh93/include/builtins.h b/src/cmd/ksh93/include/builtins.h index 7962efd81129..ef3bb1987d26 100644 --- a/src/cmd/ksh93/include/builtins.h +++ b/src/cmd/ksh93/include/builtins.h @@ -210,4 +210,3 @@ extern const char sh_optwhence[]; extern const char sh_opttimes[]; extern const char e_dict[]; - diff --git a/src/cmd/ksh93/include/defs.h b/src/cmd/ksh93/include/defs.h index 244bfb8f712a..0111c086a92d 100644 --- a/src/cmd/ksh93/include/defs.h +++ b/src/cmd/ksh93/include/defs.h @@ -37,7 +37,7 @@ #endif #if !SHOPT_MULTIBYTE /* - * Disable multibyte without need for excessive '#if SHOPT_MULTIBYTE' peprocessor conditionals. + * Disable multibyte without need for excessive '#if SHOPT_MULTIBYTE' preprocessor conditionals. * If we redefine the maximum character size mbmax() as 1 byte, the mbwide() macro will always * evaluate to 0. All the other multibyte macros have multibtye code conditional upon mbwide(), * so the compiler should optimize all of that code away. See src/lib/libast/include/ast.h @@ -161,7 +161,7 @@ struct shared Sfio_t *funlog; /* for logging function definitions */ \ int **fdptrs; /* pointer to file numbers */ \ char *lastarg; \ - char *lastpath; /* last alsolute path found */ \ + char *lastpath; /* last absolute path found */ \ int path_err; /* last error on path search */ \ Dt_t *track_tree; /* for tracked aliases*/ \ Dt_t *var_base; /* global level variables */ \ @@ -199,7 +199,7 @@ struct shared char binscript; \ char deftype; \ char funload; \ - char used_pos; /* used postional parameter */\ + char used_pos; /* used positional parameter */\ char universe; \ char winch; \ char inarith; /* set when in ((...)) */ \ diff --git a/src/cmd/ksh93/include/edit.h b/src/cmd/ksh93/include/edit.h index 724ae3f113da..1732bbed10e4 100644 --- a/src/cmd/ksh93/include/edit.h +++ b/src/cmd/ksh93/include/edit.h @@ -114,7 +114,7 @@ typedef struct edit genchar *e_physbuf; /* temporary workspace buffer */ int e_lbuf[LOOKAHEAD];/* pointer to look-ahead buffer */ int e_fd; /* file descriptor */ - int e_ttyspeed; /* line speed, also indicates tty parms are valid */ + int e_ttyspeed; /* line speed, also indicates tty parameters are valid */ int e_tabcount; #ifdef _hdr_utime ino_t e_tty_ino; diff --git a/src/cmd/ksh93/include/jobs.h b/src/cmd/ksh93/include/jobs.h index 5365152bbfe6..4b8ba7a94390 100644 --- a/src/cmd/ksh93/include/jobs.h +++ b/src/cmd/ksh93/include/jobs.h @@ -189,5 +189,4 @@ extern void job_chldtrap(Shell_t*, const char*,int); # define job_fork(p) #endif /* JOBS */ - #endif /* !JOB_NFLAG */ diff --git a/src/cmd/ksh93/include/lexstates.h b/src/cmd/ksh93/include/lexstates.h index 03069e85e80c..0447d2042dd1 100644 --- a/src/cmd/ksh93/include/lexstates.h +++ b/src/cmd/ksh93/include/lexstates.h @@ -42,7 +42,7 @@ #define S_SPC1 21 /* special prefix characters after $ */ #define S_SPC2 22 /* special characters after $ */ #define S_DIG 23 /* digit character after $ */ -#define S_ALP 24 /* alpahbetic character after $ */ +#define S_ALP 24 /* alphabetic character after $ */ #define S_LBRA 25 /* left brace after $ */ #define S_RBRA 26 /* right brace after $ */ #define S_PAR 27 /* set for $( */ @@ -55,7 +55,7 @@ #define S_DOT 34 /* . char */ #define S_META 35 /* | & ; < > inside ${...} reserved for future use */ #define S_SPACE S_BREAK /* IFS space characters */ -#define S_DELIM S_RES /* IFS delimter characters */ +#define S_DELIM S_RES /* IFS delimiter characters */ #define S_MBYTE S_NAME /* IFS first byte of multi-byte char */ #define S_BLNK 36 /* space or tab */ /* The following must be the highest numbered states */ diff --git a/src/cmd/ksh93/include/shlex.h b/src/cmd/ksh93/include/shlex.h index 1574796f2cdf..6328cc8ab37b 100644 --- a/src/cmd/ksh93/include/shlex.h +++ b/src/cmd/ksh93/include/shlex.h @@ -155,5 +155,4 @@ extern void sh_syntax(Lex_t*); extern unsigned long kiaentity(Lex_t*, const char*,int,int,int,int,unsigned long,int,int,const char*); #endif /* SHOPT_KIA */ - #endif /* !NOTSYM */ diff --git a/src/cmd/ksh93/mamexec b/src/cmd/ksh93/mamexec index e36a846092d4..106230629086 100755 --- a/src/cmd/ksh93/mamexec +++ b/src/cmd/ksh93/mamexec @@ -7,10 +7,10 @@ # # @(#)mamexec (gsf@research.att.com) 07/17/94 # -# mamexec [ -dfins ] [ target ... ] < mam-file +# mamexec [ -dfins ] [ target ... ] < mamfile # # NOTE: variables defined in this script may conflict with -# mam-file variables +# mamfile variables # _command_=mamexec @@ -39,7 +39,7 @@ do case $# in ;; -*) case $1 in -*[abceghjklmopqrtuvwxyz_A-Z0-9]*) # [!...] not portable - echo "Usage: $_command_ [ -dfins ] [ target ... ] < mam-file" >&2; exit 2 + echo "Usage: $_command_ [ -dfins ] [ target ... ] < mamfile" >&2; exit 2 ;; *) case $1 in *d*) _debug_="eval echo $_command_: debug: >&2" ;; diff --git a/src/cmd/ksh93/sh.1 b/src/cmd/ksh93/sh.1 index 007070e4f5a3..067c55fcfc8c 100644 --- a/src/cmd/ksh93/sh.1 +++ b/src/cmd/ksh93/sh.1 @@ -39,7 +39,7 @@ ksh93, rksh93 \- KornShell, a standard/restricted command and programming langua .B ksh93 .\} [ -.B \(+-abcefhiklmnoprstuvxBCDEGH +.B \(+-abcefhiklmnprstuvxBCDEGH ] [ .B \(+-o option ] .\|.\|. [ @@ -56,7 +56,7 @@ option ] .\|.\|. [ .B rksh93 .\} [ -.B \(+-abcefhiklmnopstuvxBCDEGH +.B \(+-abcefhiklmnpstuvxBCDEGH ] [ .B \(+-o option ] .\|.\|. [ @@ -416,7 +416,7 @@ that matches .IR word . The form of the patterns is the same as that used for -file-name generation (see +file name generation (see .I "File Name Generation\^" below). The @@ -1214,7 +1214,7 @@ If an array with last subscript .B * .BR @ , -or for index arrays of the form +or for indexed arrays of the form .I sub1\^ .B .. .IR sub2 . @@ -1557,7 +1557,7 @@ command. The decimal value returned by the last executed command. .TP .B $ -The process number of this shell. +The process id of this shell. .TP .B _ Initially, the value of @@ -1766,7 +1766,7 @@ built-in command. .TP .B .SM PPID -The process number of the parent of the shell. +The process id of the parent of the shell. .TP .B .SM PWD @@ -2965,6 +2965,7 @@ can be used within an arithmetic expression: .if n abs acos acosh asin asinh atan atan2 atanh cbrt ceil copysign cos cosh erf erfc exp exp2 expm1 fabs fpclassify fdim finite floor fma fmax fmin fmod hypot ilogb int isfinite sinf isnan isnormal issubnormal issubordered iszero j0 j1 jn lgamma log log10 log2 logb nearbyint nextafter nexttoward pow remainder rint round scanb signbit sin sinh sqrt tan tanh tgamma trunc y0 y1 yn .if t abs acos acosh asin asinh atan atan2 atanh cbrt ceil copysign cos cosh erf erfc exp exp2 expm1 fabs fpclassify fdim finite floor fma fmax fmod j0 j1 jn hypot ilogb int isfinite isinf isnan isnormal issubnormal issubordered iszero lgamma log log10 log2 logb nearbyint nextafter nexttoward pow rint round scalb signbit sin sinh sqrt tan tanh tgamma trunc y0 y1 yn .if t .RE + In addition, arithmetic functions can be defined as shell functions with a variant of the .B function @@ -6147,7 +6148,7 @@ The pathname is used for each of the parameters that requires .IR pathname . .TP -\f3getopts\fP \*(OK \f3\ \-a\fP \f2name\^\fP \*(CK \f2optstring vname\^\fP \*(OK \f2arg\^\fP .\|.\|. \*(CK +\f3getopts\fP \*(OK \f3\-a\fP \f2name\^\fP \*(CK \f2optstring vname\^\fP \*(OK \f2arg\^\fP .\|.\|. \*(CK Checks .I arg for legal options. @@ -6266,7 +6267,7 @@ option empties the hash table. This can also be achieved by resetting .PD 0 \f3hist\fP \*(OK \f3\-e\fP \f2ename\^\fP \ \*(CK \*(OK \f3\-N\fP \f2num\^\fP \*(CK \*(OK \f3\-nlr\^\fP \*(CK \*(OK \f2first\^\fP \*(OK \f2last\^\fP \*(CK \*(CK .TP -\f3hist \-s \fP \*(OK \f2old\fP\f3\=\fP\f2new\^\fP \*(CK \*(OK \f2command\^\fP \*(CK +\f3hist \-s\fP \*(OK \f2old\fP\f3\=\fP\f2new\^\fP \*(CK \*(OK \f2command\^\fP \*(CK .PD In the first form, a range of commands from @@ -6507,7 +6508,7 @@ The formfeed character (ascii .BR 014 ). .TP .B \en -The new-line character (ascii +The newline character (ascii .BR 012 ). .TP .B \er @@ -6641,6 +6642,11 @@ The alternate flag .B # formats the output for use as a URI. .TP +.B %p +A +.B %p +format will convert the given number to hexadecimal. +.TP .B %P A .B %P @@ -6651,16 +6657,6 @@ to cause to be interpreted as an extended regular expression and be printed as a shell pattern. .TP -.B %R -A -.B %R -format can be used instead of -.B %s -to cause -.I arg\^ -to be interpreted as a shell pattern -and to be printed as an extended regular expression. -.TP .B %q A .B %q @@ -6683,6 +6679,21 @@ format can be used to treat an argument as a date/time string and to format the date/time according to the .IR date-format . .TP +.B %Q +A +.B %Q +format will convert the given number of seconds to readable time. +.TP +.B %R +A +.B %R +format can be used instead of +.B %s +to cause +.I arg\^ +to be interpreted as a shell pattern +and to be printed as an extended regular expression. +.TP .B %Z A .B %Z @@ -6953,7 +6964,7 @@ script, then it behaves the same as .BR exit . .TP -\(dg \f3set\fP \*(OK \f3\(+-BCGabefhkmnoprstuvx\fP \*(CK \*(OK \f3\(+-o\fP \*(OK \f2option\^\fP \*(CK \*(CK .\|.\|. \*(OK \f3\(+-A\fP \f2vname\^\fP \*(CK \*(OK \f2arg\^\fP .\|.\|. \*(CK +\(dg \f3set\fP \*(OK \f3\(+-BCGHabefhkmnprstuvx\fP \*(CK \*(OK \f3\(+-o\fP \*(OK \f2option\^\fP \*(CK \*(CK .\|.\|. \*(OK \f3\(+-A\fP \f2vname\^\fP \*(CK \*(OK \f2arg\^\fP .\|.\|. \*(CK The options for this command have meaning as follows: .RS .PD 0 @@ -7576,7 +7587,7 @@ for infinite loops. The same as .BR whence\ \-v . .TP -\(dg\(dd \f3typeset\fP \*(OK \f3\(+-ACHSfblmnprtux\^\fP \*(CK \*(OK \f3\(+-EFLRXZi\*(OK\f2n\^\fP\*(CK \*(CK \*(OK \f3\+-M \*(OK \f2mapname\fP \*(CK \*(CK \*(OK \f3\-T \*(OK \f2tname\fP=(\f2assign_list\fP) \*(CK \*(CK \*(OK \f3\-h \f2str\fP \*(CK \*(OK \f3\-a\fP \*(OK\f2type\fP\*(CK \*(CK \*(OK \f2vname\^\fP\*(OK\f3=\fP\f2value\^\fP \*(CK \^ \*(CK .\|.\|. +\(dg\(dd \f3typeset\fP \*(OK \f3\(+-ACHSbflmnprstux\^\fP \*(CK \*(OK \f3\(+-EFLRXZi\*(OK\f2n\^\fP\*(CK \*(CK \*(OK \f3\+-M \*(OK \f2mapname\fP \*(CK \*(CK \*(OK \f3\-T \*(OK \f2tname\fP=(\f2assign_list\fP) \*(CK \*(CK \*(OK \f3\-h \f2str\fP \*(CK \*(OK \f3\-a\fP \*(OK\f2type\fP\*(CK \*(CK \*(OK \f2vname\^\fP\*(OK\f3=\fP\f2value\^\fP \*(CK \^ \*(CK .\|.\|. Sets attributes and values for shell variables and functions. When invoked inside a function defined with the .B function @@ -7876,6 +7887,11 @@ readonly and these names cannot be changed by subsequent assignment. .TP +.B \-s +When given along with +.BR \-i , +restricts integer size to short. +.TP .B \-t Tags the variables. Tags are user definable and have no special @@ -8051,7 +8067,7 @@ The number of 512-byte blocks for pipe buffering. The message queue size in K-bytes. .TP .B \-r -The max real time priority. +The max real-time priority. .TP .B \-s The number of K-bytes on the size of the stack area. @@ -8265,11 +8281,9 @@ After this, if the shell was assumed to be a .I login shell, commands are read from .B /etc/profile -and then from either -.B .profile -in the current directory or -.BR \s-1$HOME\s+1/.profile , -if either file exists. +and then from +.BR \s-1$HOME\s+1/.profile +if it exists. Next, for interactive shells, commands are read from the file named by .SM @@ -8528,6 +8542,7 @@ cat(1), cd(1), chmod(1), cut(1), +date(1), egrep(1), echo(1), emacs(1), @@ -8574,6 +8589,8 @@ original command was found, the shell will continue to .I exec\^ the original command. Use the +.B hash\^ +command or the .B \-t option of the .B alias\^ diff --git a/src/cmd/ksh93/sh.memo b/src/cmd/ksh93/sh.memo index 455e97965fdb..a4502558ef6d 100644 --- a/src/cmd/ksh93/sh.memo +++ b/src/cmd/ksh93/sh.memo @@ -484,7 +484,7 @@ prior to evaluation. A convenient alias, .ce \f5alias r='hist -s'\fP -has been pre-defined so that +has been predefined so that the single key-stroke \f5r\fP can be used to re-execute the previous command @@ -975,7 +975,7 @@ The value of variable is the value of the most recent assignment plus the elapsed time. -By default, the time is measured in milli-seconds, +By default, the time is measured in milliseconds, but since .B \s-1SECONDS\s+1 is a floating point variable, the @@ -2706,7 +2706,7 @@ A third reason to have a command built-in is so that it will be unaffected by the setting of the .B \s-1PATH\s+1 variable. -The \f5print\fP command fits this category. +The \f5print\fP command fits this category. Scripts that use \f5print\fP will be portable to all sites that run \f5ksh\fP. .P diff --git a/src/cmd/ksh93/sh/args.c b/src/cmd/ksh93/sh/args.c index 339452407498..c731158fd3dd 100644 --- a/src/cmd/ksh93/sh/args.c +++ b/src/cmd/ksh93/sh/args.c @@ -814,4 +814,3 @@ static int arg_expand(Shell_t *shp,register struct argnod *argp, struct argnod * } return(count); } - diff --git a/src/cmd/ksh93/sh/array.c b/src/cmd/ksh93/sh/array.c index 4317bd00b011..6decffa0d916 100644 --- a/src/cmd/ksh93/sh/array.c +++ b/src/cmd/ksh93/sh/array.c @@ -1793,7 +1793,7 @@ void nv_setvec(register Namval_t *np,int append,register int argc,register char { ap = (struct index_array*)nv_arrayptr(np); if(ap && is_associative(ap)) - errormsg(SH_DICT,ERROR_exit(1),"cannot append index array to associative array %s",nv_name(np)); + errormsg(SH_DICT,ERROR_exit(1),"cannot append indexed array to associative array %s",nv_name(np)); } if(append) { @@ -1818,4 +1818,3 @@ void nv_setvec(register Namval_t *np,int append,register int argc,register char nv_putval(np,argv[argc],0); } } - diff --git a/src/cmd/ksh93/sh/defs.c b/src/cmd/ksh93/sh/defs.c index 308ce22fe2fa..2e34019ee208 100644 --- a/src/cmd/ksh93/sh/defs.c +++ b/src/cmd/ksh93/sh/defs.c @@ -45,4 +45,3 @@ char *sh_lexstates[ST_NONE] = {0}; struct jobs job = {0}; int32_t sh_mailchk = 600; - diff --git a/src/cmd/ksh93/sh/deparse.c b/src/cmd/ksh93/sh/deparse.c index 4e8f82146f00..e37e7e5c9d4d 100644 --- a/src/cmd/ksh93/sh/deparse.c +++ b/src/cmd/ksh93/sh/deparse.c @@ -588,4 +588,3 @@ static void here_body(register const struct ionod *iop) sfclose(infile); sfputr(outfile,iop->iodelim,'\n'); } - diff --git a/src/cmd/ksh93/sh/fault.c b/src/cmd/ksh93/sh/fault.c index 0b535b3bb079..d39662676400 100644 --- a/src/cmd/ksh93/sh/fault.c +++ b/src/cmd/ksh93/sh/fault.c @@ -681,4 +681,3 @@ void sh_done(void *ptr, register int sig) exit(savxit&SH_EXITMASK); } - diff --git a/src/cmd/ksh93/sh/fcin.c b/src/cmd/ksh93/sh/fcin.c index e2566bc0ec0b..5b853bf24211 100644 --- a/src/cmd/ksh93/sh/fcin.c +++ b/src/cmd/ksh93/sh/fcin.c @@ -167,4 +167,3 @@ int _fcmbget(short *len) } return(c); } - diff --git a/src/cmd/ksh93/sh/io.c b/src/cmd/ksh93/sh/io.c index 8877df4bdeca..7ab4bc8161d9 100644 --- a/src/cmd/ksh93/sh/io.c +++ b/src/cmd/ksh93/sh/io.c @@ -286,7 +286,7 @@ inetopen(const char* path, int flags, Inetintr_f onintr, void* handle) for (p = addr; p; p = p->ai_next) { /* - * some api's don't take the hint + * some APIs don't take the hint */ if (!p->ai_protocol) @@ -1533,7 +1533,7 @@ static int io_heredoc(Shell_t *shp,register struct ionod *iop, const char *name, { /* * the locking is only needed in case & blocks process - * here-docs so this can be eliminted in some cases + * here-docs so this can be eliminated in some cases */ struct flock lock; int fno = sffileno(shp->heredocs); @@ -2676,4 +2676,3 @@ int sh_chdir(const char* dir) errno = err; return(r); } - diff --git a/src/cmd/ksh93/sh/jobs.c b/src/cmd/ksh93/sh/jobs.c index 873bd1170c04..6c019f19741a 100644 --- a/src/cmd/ksh93/sh/jobs.c +++ b/src/cmd/ksh93/sh/jobs.c @@ -1975,4 +1975,3 @@ void job_fork(pid_t parent) break; } } - diff --git a/src/cmd/ksh93/sh/lex.c b/src/cmd/ksh93/sh/lex.c index 359bb46f0bbf..bab23e0408e0 100644 --- a/src/cmd/ksh93/sh/lex.c +++ b/src/cmd/ksh93/sh/lex.c @@ -1649,7 +1649,7 @@ static int comsub(register Lex_t *lp, int endtok) goto rbrace; if(c>0) fcseek(-LEN); - /* fall through*/ + /* fall through */ default: lp->lex.reservok = 1; } @@ -2495,4 +2495,3 @@ static int stack_grow(Lex_t *lp) lp->lexd.lex_match = (int*)sh_malloc(sizeof(int)*STACK_ARRAY); return(1); } - diff --git a/src/cmd/ksh93/sh/name.c b/src/cmd/ksh93/sh/name.c index 23ebde43a928..e9a348b06817 100644 --- a/src/cmd/ksh93/sh/name.c +++ b/src/cmd/ksh93/sh/name.c @@ -82,7 +82,7 @@ struct adata short numnodes; short maxnodes; }; -#endif /*SHOPT_TYPEDEF */ +#endif /* SHOPT_TYPEDEF */ #if NVCACHE struct Namcache @@ -1227,7 +1227,7 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp) * delete the node from the dictionary and clear from the cache * if is NULL, only the cache is cleared * if flags does not contain NV_NOFREE, the node is freed - * if np==0 && !root && flags==0, delete the Refdict dictionary + * if np==0 && !root && flags==0, delete the Refdict dictionary */ void nv_delete(Namval_t* np, Dt_t *root, int flags) { @@ -2232,7 +2232,7 @@ static int scanfilter(Dt_t *dict, void *arg, void *data) #if SHOPT_TYPEDEF if(!is_abuiltin(np) && tp && tp->tp && nv_type(np)!=tp->tp) return(0); -#endif /*SHOPT_TYPEDEF */ +#endif /* SHOPT_TYPEDEF */ if(sp->scanmask==NV_TABLE && nv_isvtree(np)) k = NV_TABLE; if(sp->scanmask?(k&sp->scanmask)==sp->scanflags:(!sp->scanflags || (k&sp->scanflags))) diff --git a/src/cmd/ksh93/sh/nvdisc.c b/src/cmd/ksh93/sh/nvdisc.c index 983db93138ac..b1fce28b6de5 100644 --- a/src/cmd/ksh93/sh/nvdisc.c +++ b/src/cmd/ksh93/sh/nvdisc.c @@ -909,7 +909,7 @@ void clone_all_disc( Namval_t *np, Namval_t *mp, int flags) * NV_APPEND - append onto * NV_MOVE - move to * NV_NOFREE - mark the new node as nofree - * NV_NODISC - discplines with funs non-zero will not be copied + * NV_NODISC - disciplines with funs non-zero will not be copied * NV_COMVAR - cloning a compound variable */ int nv_clone(Namval_t *np, Namval_t *mp, int flags) diff --git a/src/cmd/ksh93/sh/nvtree.c b/src/cmd/ksh93/sh/nvtree.c index 92e45863f3f9..9fb371eb99d4 100644 --- a/src/cmd/ksh93/sh/nvtree.c +++ b/src/cmd/ksh93/sh/nvtree.c @@ -885,7 +885,7 @@ static char **genvalue(char **argv, const char *prefix, int n, struct Walk *wp) } else if(outfile && *cp=='[' && cp[-1]!='.') { - /* skip multi-dimensional arrays */ + /* skip multidimensional arrays */ if(*nv_endsubscript((Namval_t*)0,cp,0)=='[') continue; if(wp->indent>0) diff --git a/src/cmd/ksh93/sh/nvtype.c b/src/cmd/ksh93/sh/nvtype.c index 3f41f6844b14..f2ffa873f155 100644 --- a/src/cmd/ksh93/sh/nvtype.c +++ b/src/cmd/ksh93/sh/nvtype.c @@ -1327,7 +1327,7 @@ int nv_settype(Namval_t* np, Namval_t *tp, int flags) } } else -#endif /*SHOPT_TYPEDEF */ +#endif /* SHOPT_TYPEDEF */ { if(isnull) flags &= ~NV_APPEND; diff --git a/src/cmd/ksh93/sh/parse.c b/src/cmd/ksh93/sh/parse.c index 241695fec2d2..ffaa9b627043 100644 --- a/src/cmd/ksh93/sh/parse.c +++ b/src/cmd/ksh93/sh/parse.c @@ -1077,7 +1077,7 @@ static struct argnod *assign(Lex_t *lexp, register struct argnod *ap, int type) struct argnod *arg = lexp->arg; if(n!=0) sh_syntax(lexp); - /* check for sys5 style function */ + /* check for SysV style function */ if(sh_lex(lexp)!=LPAREN || sh_lex(lexp)!=RPAREN) { lexp->arg = arg; @@ -1384,7 +1384,7 @@ static Shnode_t *simple(Lex_t *lexp,int flag, struct ionod *io) associative = 1; } t = (struct comnod*)getnode(comnod); - t->comio=io; /*initial io chain*/ + t->comio=io; /* initial io chain */ /* set command line number for error messages */ t->comline = sh_getlineno(lexp); argtail = &(t->comarg); diff --git a/src/cmd/ksh93/sh/path.c b/src/cmd/ksh93/sh/path.c index f809e3915d59..fd85316588bf 100644 --- a/src/cmd/ksh93/sh/path.c +++ b/src/cmd/ksh93/sh/path.c @@ -1439,7 +1439,7 @@ static void exscript(Shell_t *shp,register char *path,register char *argv[],char /* - * add a pathcomponent to the path search list and eliminate duplicates + * add a path component to the path search list and eliminate duplicates * and non-existing absolute paths. */ static Pathcomp_t *path_addcomp(Shell_t *shp,Pathcomp_t *first, Pathcomp_t *old,const char *name, int flag) @@ -1813,4 +1813,3 @@ void path_alias(register Namval_t *np,register Pathcomp_t *pp) else _nv_unset(np,0); } - diff --git a/src/cmd/ksh93/sh/string.c b/src/cmd/ksh93/sh/string.c index 1111bb7bf9fe..027c43cec8b8 100644 --- a/src/cmd/ksh93/sh/string.c +++ b/src/cmd/ksh93/sh/string.c @@ -48,7 +48,7 @@ /* * Table lookup routine * is searched for string and corresponding value is returned - * This is only used for small tables and is used to save non-sharable memory + * This is only used for small tables and is used to save non-shareable memory */ const Shtable_t *sh_locate(register const char *sp,const Shtable_t *table,int size) @@ -353,7 +353,7 @@ static int sh_isprint(int c) /* * print quoting chars so that it can be read by the shell - * puts null terminated result on stack, but doesn't freeze it + * puts null-terminated result on stack, but doesn't freeze it */ char *sh_fmtq(const char *string) { @@ -475,7 +475,7 @@ char *sh_fmtq(const char *string) /* * print quoting chars so that it can be read by the shell - * puts null terminated result on stack, but doesn't freeze it + * puts null-terminated result on stack, but doesn't freeze it * single!=0 limits quoting to '...' * fold>0 prints raw newlines and inserts appropriately * escaped newlines every (fold-x) chars diff --git a/src/cmd/ksh93/sh/suid_exec.c b/src/cmd/ksh93/sh/suid_exec.c index 7ea2df1fc888..6fb212a0e705 100644 --- a/src/cmd/ksh93/sh/suid_exec.c +++ b/src/cmd/ksh93/sh/suid_exec.c @@ -58,7 +58,7 @@ #define SPECIAL 04100 /* setuid execute only by owner */ #define FDIN 10 /* must be same as /dev/fd below */ #undef FDSYNC -#define FDSYNC 11 /* used on sys5 to synchronize cleanup */ +#define FDSYNC 11 /* used on SysV to synchronize cleanup */ #define FDVERIFY 12 /* used to validate /tmp process */ #undef BLKSIZE #define BLKSIZE sizeof(char*)*1024 @@ -514,5 +514,3 @@ static int mycopy(int fdi, int fdo) } #endif /* _lib_setreuid */ - - diff --git a/src/cmd/ksh93/sh/timers.c b/src/cmd/ksh93/sh/timers.c index cab8204d8924..019d7e514802 100644 --- a/src/cmd/ksh93/sh/timers.c +++ b/src/cmd/ksh93/sh/timers.c @@ -242,4 +242,3 @@ void timerdel(void *handle) signal(SIGALRM,(sh.sigflag[SIGALRM]&SH_SIGFAULT)?sh_fault:SIG_DFL); } } - diff --git a/src/cmd/ksh93/sh/xec.c b/src/cmd/ksh93/sh/xec.c index a40adf5c28b6..f60ff9e9befc 100644 --- a/src/cmd/ksh93/sh/xec.c +++ b/src/cmd/ksh93/sh/xec.c @@ -1091,7 +1091,7 @@ int sh_exec(register const Shnode_t *t, int flags) if(!np && !strchr(com0,'/')) { Dt_t *root = command?shp->bltin_tree:shp->fun_tree; - np = nv_bfsearch(com0, root, &nq, &cp); + np = nv_bfsearch(com0, root, &nq, &cp); #if SHOPT_NAMESPACE if(shp->namespace && !nq && !cp) np = sh_fsearch(shp,com0,0); @@ -1844,7 +1844,7 @@ int sh_exec(register const Shnode_t *t, int flags) sh_iorenumber(shp,shp->inpipe[0],0); /* * if read end of pipe is a simple command - * treat as non-sharable to improve performance + * treat as non-shareable to improve performance */ if(simple) sfset(sfstdin,SF_PUBLIC|SF_SHARE,0); @@ -2051,7 +2051,7 @@ int sh_exec(register const Shnode_t *t, int flags) #ifdef SIGTSTP if(!pipejob && sh_isstate(SH_MONITOR) && job.jobcontrol) tcsetpgrp(JOBTTY,shp->gd->pid); -#endif /*SIGTSTP */ +#endif /* SIGTSTP */ job.curpgid = savepgid; job.exitval = saveexitval; job.waitall = savewaitall; @@ -2204,7 +2204,7 @@ int sh_exec(register const Shnode_t *t, int flags) sh_optclear(shp,optlist); if(jmpval) siglongjmp(*shp->jmplist,jmpval); -#endif /*SHOPT_OPTIMIZE */ +#endif /* SHOPT_OPTIMIZE */ if(shp->st.breakcnt>0) shp->st.execbrk = (--shp->st.breakcnt !=0); shp->st.loopcnt--; @@ -2221,7 +2221,7 @@ int sh_exec(register const Shnode_t *t, int flags) #if SHOPT_FILESCAN Sfio_t *iop=0; int savein=-1; -#endif /*SHOPT_FILESCAN*/ +#endif /* SHOPT_FILESCAN */ #if SHOPT_OPTIMIZE int jmpval = ((struct checkpt*)shp->jmplist)->mode; struct checkpt *buffp = (struct checkpt*)stkalloc(shp->stk,sizeof(struct checkpt)); @@ -2243,7 +2243,7 @@ int sh_exec(register const Shnode_t *t, int flags) if(tt->com.comset) nv_setlist(tt->com.comset,NV_IDENT|NV_ASSIGN,0); } -#endif /*SHOPT_FILESCAN */ +#endif /* SHOPT_FILESCAN */ shp->st.loopcnt++; while(shp->st.execbrk==0) { @@ -2254,7 +2254,7 @@ int sh_exec(register const Shnode_t *t, int flags) break; } else -#endif /*SHOPT_FILESCAN */ +#endif /* SHOPT_FILESCAN */ if((sh_exec(tt,first)==0)!=(type==TWH)) break; r = sh_exec(t->wh.dotre,first|errorflg); @@ -2268,7 +2268,7 @@ int sh_exec(register const Shnode_t *t, int flags) #if SHOPT_FILESCAN shp->offsets[0] = -1; shp->offsets[1] = 0; -#endif /*SHOPT_FILESCAN */ +#endif /* SHOPT_FILESCAN */ } #if SHOPT_OPTIMIZE endwhile: @@ -2278,7 +2278,7 @@ int sh_exec(register const Shnode_t *t, int flags) sh_optclear(shp,optlist); if(jmpval) siglongjmp(*shp->jmplist,jmpval); -#endif /*SHOPT_OPTIMIZE */ +#endif /* SHOPT_OPTIMIZE */ if(shp->st.breakcnt>0) shp->st.execbrk = (--shp->st.breakcnt !=0); shp->st.loopcnt--; @@ -2291,7 +2291,7 @@ int sh_exec(register const Shnode_t *t, int flags) dup(savein); shp->cur_line = 0; } -#endif /*SHOPT_FILESCAN */ +#endif /* SHOPT_FILESCAN */ break; } case TARITH: /* (( expression )) */ diff --git a/src/cmd/ksh93/tests/alias.sh b/src/cmd/ksh93/tests/alias.sh index 45e7d7a06f61..d6fa20e467c8 100755 --- a/src/cmd/ksh93/tests/alias.sh +++ b/src/cmd/ksh93/tests/alias.sh @@ -91,7 +91,7 @@ unalias no_such_alias && err_exit 'unalias should return non-zero for unknown al # ====== # Adding a utility after resetting the hash table should work hash -r chmod -[[ $(hash) == "chmod=$(whence -p chmod)" ]] || err_exit $'resetting the hash table with `hash -r \'utility\'` doesn\'t work correctly' +[[ $(hash) == "chmod=$(whence -p chmod)" ]] || err_exit $'"hash -r \'utility\'" doesn\'t reset the hash table correctly' # ====== # Attempting to unalias a previously set alias twice should be an error diff --git a/src/cmd/ksh93/tests/append.sh b/src/cmd/ksh93/tests/append.sh index faf64f51c112..48b1d0c7ec1e 100755 --- a/src/cmd/ksh93/tests/append.sh +++ b/src/cmd/ksh93/tests/append.sh @@ -34,13 +34,13 @@ fi iarray=( one two three ) { iarray+= (four five six) ;} 2> /dev/null if [[ ${iarray[@]} != 'one two three four five six' ]] -then err_exit 'index array append fails' +then err_exit 'indexed array append fails' fi unset iarray iarray=one { iarray+= (four five six) ;} 2> /dev/null if [[ ${iarray[@]} != 'one four five six' ]] -then err_exit 'index array append to scalar fails' +then err_exit 'indexed array append to scalar fails' fi typeset -A aarray aarray=( [1]=1 [3]=4 [xyz]=xyz ) @@ -68,8 +68,8 @@ fi unset foo foo[0]=(x=3) foo+=(x=4) -[[ ${foo[1].x} == 4 ]] || err_exit 'compound append to index array not working' -[[ ${foo[0].x} == 3 ]] || err_exit 'compound append to index array unsets existing variables' +[[ ${foo[1].x} == 4 ]] || err_exit 'compound append to indexed array not working' +[[ ${foo[0].x} == 3 ]] || err_exit 'compound append to indexed array unsets existing variables' unset foo foo=a @@ -80,23 +80,23 @@ unset x z arr typeset -a x=(a b) x+=(c d) exp='typeset -a x=(a b c d)' -[[ $(typeset -p x) == "$exp" ]] || err_exit 'append (c d) to index array not working' +[[ $(typeset -p x) == "$exp" ]] || err_exit 'append (c d) to indexed array not working' typeset -a arr=(a=b b=c) arr+=(c=d d=e) exp='typeset -a arr=(a\=b b\=c c\=d d\=e)' -[[ $(typeset -p arr) == "$exp" ]] || err_exit 'append (c=d d=e) to index array not working' +[[ $(typeset -p arr) == "$exp" ]] || err_exit 'append (c=d d=e) to indexed array not working' exp='typeset -a z=(a\=b b\=c d\=3 e f\=l)' typeset -a z=(a=b b=c) { z+=(d=3 e f=l); } 2> /dev/null -[[ $(typeset -p z) == "$exp" ]] || err_exit 'append (d=3 e f=l) to index array not working' +[[ $(typeset -p z) == "$exp" ]] || err_exit 'append (d=3 e f=l) to indexed array not working' unset arr2 exp='typeset -a arr2=(b\=c :)' typeset -a arr2 arr2+=(b=c :) -[[ $(typeset -p arr2) == "$exp" ]] || err_exit 'append (b=c :) to index array not working' +[[ $(typeset -p arr2) == "$exp" ]] || err_exit 'append (b=c :) to indexed array not working' unset arr2 exp='typeset -a arr2=(b\=c xxxxx)' @@ -104,6 +104,6 @@ typeset -a arr2 { arr2+=(b=c xxxxx) } 2> /dev/null -[[ $(typeset -p arr2) == "$exp" ]] || err_exit 'append (b=c xxxxx) to index array not working' +[[ $(typeset -p arr2) == "$exp" ]] || err_exit 'append (b=c xxxxx) to indexed array not working' exit $((Errors<125?Errors:125)) diff --git a/src/cmd/ksh93/tests/arith.sh b/src/cmd/ksh93/tests/arith.sh index dd39c24a2139..251d2c2bf9ce 100755 --- a/src/cmd/ksh93/tests/arith.sh +++ b/src/cmd/ksh93/tests/arith.sh @@ -195,20 +195,20 @@ unset x integer y[3]=9 y[4]=2 i=3 (( x = y[3] + y[4] )) if [[ $x != 11 ]] -then err_exit "constant index array arithmetic failure" +then err_exit "constant indexed array arithmetic failure" fi (( x = $empty y[3] + y[4] )) if [[ $x != 11 ]] -then err_exit "empty constant index array arithmetic failure" +then err_exit "empty constant indexed array arithmetic failure" fi (( x = y[i] + y[i+1] )) if [[ $x != 11 ]] -then err_exit "variable subscript index array arithmetic failure" +then err_exit "variable subscript indexed array arithmetic failure" fi integer a[5]=3 a[2]=4 (( x = y[a[5]] + y[a[2]] )) if [[ $x != 11 ]] -then err_exit "nested subscript index array arithmetic failure" +then err_exit "nested subscript indexed array arithmetic failure" fi unset y typeset -Ai y @@ -667,7 +667,7 @@ $SHELL 2> /dev/null -c 'str="0x1.df768ed398ee1e01329a130627ae0000p-1";typeset -l x=(3 6 12) (( x[2] /= x[0])) -(( x[2] == 4 )) || err_exit '(( x[2] /= x[0])) fails for index array' +(( x[2] == 4 )) || err_exit '(( x[2] /= x[0])) fails for indexed array' x=([0]=3 [1]=6 [2]=12) (( x[2] /= x[0])) @@ -699,27 +699,27 @@ unset A[a] A[a]=(typeset -a AA) A[a].AA[aa]=1 (( z += A[a].AA[aa++]++ )) -(( z == 2 )) || err_exit "z should be '2' but is '$z' for associative array of index array arithmetic" +(( z == 2 )) || err_exit "z should be '2' but is '$z' for associative array of indexed array arithmetic" (( aa == 3 )) || err_exit "subscript aa should be '3' but is '$aa' after ++" [[ ${A[a].AA[aa-1]} == 2 ]] || err_exit "\${A[a].AA[aa]} should be '2' but is '${A[a].AA[aa]}'" \ - 'after ++ operation for associative array of index array arithmetic' + 'after ++ operation for associative array of indexed array arithmetic' unset A typeset -a A A[a]=(typeset -A AA) A[a].AA[aa]=1 (( z += A[a].AA[aa]++ )) -(( z == 3 )) || err_exit "z should be '3' but is '$z' for index array of associative array arithmetic" +(( z == 3 )) || err_exit "z should be '3' but is '$z' for indexed array of associative array arithmetic" [[ ${A[a].AA[aa]} == 2 ]] || err_exit "\${A[a].AA[aa]} should be '2' but is '${A[a].AA[aa]}'" \ - 'after ++ operation for index array of associative array arithmetic' + 'after ++ operation for indexed array of associative array arithmetic' unset A[a] A[a]=(typeset -a AA) A[a].AA[aa]=1 (( z += A[a++].AA[aa++]++ )) -(( z == 4 )) || err_exit "z should be '4' but is '$z' for index array of index array arithmetic" +(( z == 4 )) || err_exit "z should be '4' but is '$z' for indexed array of indexed array arithmetic" [[ ${A[a-1].AA[aa-1]} == 2 ]] || err_exit "\${A[a].AA[aa]} should be '2' but is '${A[a].AA[aa]}'" \ - 'after ++ operation for index array of index array arithmetic' + 'after ++ operation for indexed array of indexed array arithmetic' (( aa == 4 )) || err_exit "subscript aa should be '4' but is '$aa' after ++" (( a == 2 )) || err_exit "subscript a should be '2' but is '$a' after ++" unset A diff --git a/src/cmd/ksh93/tests/arrays.sh b/src/cmd/ksh93/tests/arrays.sh index dcf20b73193e..f94496b53e6e 100755 --- a/src/cmd/ksh93/tests/arrays.sh +++ b/src/cmd/ksh93/tests/arrays.sh @@ -288,13 +288,13 @@ fi unset x x=( 1 2 3) (x[1]=8) -[[ ${x[1]} == 2 ]] || err_exit 'index array produce side effects in subshells' +[[ ${x[1]} == 2 ]] || err_exit 'indexed array produce side effects in subshells' x=( 1 2 3) ( x+=(8) - [[ ${#x[@]} == 4 ]] || err_exit 'index array append in subshell error' + [[ ${#x[@]} == 4 ]] || err_exit 'indexed array append in subshell error' ) -[[ ${#x[@]} == 3 ]] || err_exit 'index array append in subshell effects parent' +[[ ${#x[@]} == 3 ]] || err_exit 'indexed array append in subshell effects parent' x=( [one]=1 [two]=2 [three]=3) (x[two]=8) [[ ${x[two]} == 2 ]] || err_exit 'associative array produce side effects in subshells' @@ -310,7 +310,7 @@ integer i for ((i=0; i < 40; i++)) do x[i]=$i done -[[ ${#x[@]} == 40 ]] || err_exit 'index arrays losing values' +[[ ${#x[@]} == 40 ]] || err_exit 'indexed arrays losing values' [[ $( ($SHELL -c 'typeset -A var; (IFS=: ; set -A var a:b:c ;print ${var[@]});:' )2>/dev/null) == 'a b c' ]] || err_exit 'change associative to index failed' unset foo [[ $(foo=good @@ -482,7 +482,7 @@ function x.get } x[2]= z=$(: ${x[1]} ) -[[ $z == sub=1 ]] || err_exit 'get function not invoked for index array' +[[ $z == sub=1 ]] || err_exit 'get function not invoked for indexed array' unset x typeset -A x @@ -498,8 +498,8 @@ unset y i=1 a=(11 22) typeset -m y=a[i] -[[ $y == 22 ]] || err_exit 'typeset -m for index array not working' -[[ ${a[i]} || ${a[0]} != 11 ]] && err_exit 'typeset -m for index array not deleting element' +[[ $y == 22 ]] || err_exit 'typeset -m for indexed array not working' +[[ ${a[i]} || ${a[0]} != 11 ]] && err_exit 'typeset -m for indexed array not deleting element' unset y a=([0]=11 [1]=22) @@ -512,7 +512,7 @@ typeset -a a=( [0]="aa" [1]="bb" [2]="cc" ) typeset -m 'j=a[0]' typeset -m 'a[0]=a[1]' typeset -m 'a[1]=j' -[[ ${a[@]} == 'bb aa cc' ]] || err_exit 'moving index array elements not working' +[[ ${a[@]} == 'bb aa cc' ]] || err_exit 'moving indexed array elements not working' unset a j [[ $(typeset -p a) ]] && err_exit 'unset associative array after typeset -m not working' @@ -526,12 +526,12 @@ unset a j z=(a b c) unset x typeset -m x[1]=z -[[ ${x[1][@]} == 'a b c' ]] || err_exit 'moving indexed array to index array element not working' +[[ ${x[1][@]} == 'a b c' ]] || err_exit 'moving indexed array to indexed array element not working' unset x z z=([0]=a [1]=b [2]=c) typeset -m x[1]=z -[[ ${x[1][@]} == 'a b c' ]] || err_exit 'moving associative array to index array element not working' +[[ ${x[1][@]} == 'a b c' ]] || err_exit 'moving associative array to indexed array element not working' { typeset -a arr=( @@ -583,7 +583,7 @@ foo=( ${foo[yy]} ${foo[zz]} ) unset foo typeset -a foo=(abc=1 def=2) -[[ ${foo[1]} == def=2 ]] || err_exit "index array with elements containing = not working" +[[ ${foo[1]} == def=2 ]] || err_exit "indexed array with elements containing = not working" unset foo typeset -a foo=( a b ) @@ -607,7 +607,7 @@ x=$( ) 2> /dev/null [[ $x == "$exp" ]] || err_exit 'setting element 1 of array to compound variable failed' -#test for cloning a very large index array - can core dump +# test for cloning a very large indexed array - can core dump ( trap 'x=$?;exit $(( $x!=0 ))' EXIT $SHELL <<- \EOF diff --git a/src/cmd/ksh93/tests/arrays2.sh b/src/cmd/ksh93/tests/arrays2.sh index 322f427cb768..fab78126e4a3 100755 --- a/src/cmd/ksh93/tests/arrays2.sh +++ b/src/cmd/ksh93/tests/arrays2.sh @@ -156,7 +156,7 @@ done [[ ${#ar[*]} == 9 ]] || err_exit "\${#ar[*]} is '${#ar[*]}', should be 9" [[ ${ar[4][4]} == 40 ]] || err_exit "ar[4][4] is '${ar[4][4]}', should be 40" -$SHELL 2> /dev/null -c 'compound c;float -a c.ar;(( c.ar[2][3][3] = 5))' || 'multi-dimensional arrays in arithmetic expressions not working' +$SHELL 2> /dev/null -c 'compound c;float -a c.ar;(( c.ar[2][3][3] = 5))' || 'multidimensional arrays in arithmetic expressions not working' expected='typeset -a -l -E c.ar=([2]=([3]=([3]=5) ) )' unset c diff --git a/src/cmd/ksh93/tests/attributes.sh b/src/cmd/ksh93/tests/attributes.sh index a7cfb959c46d..43432e15f9ac 100755 --- a/src/cmd/ksh93/tests/attributes.sh +++ b/src/cmd/ksh93/tests/attributes.sh @@ -460,7 +460,7 @@ typeset -a x=( a=3 b=4) unset z z='typeset -a q=(a b c)' -$SHELL -c "$z; [[ \$(typeset -pa) == '$z' ]]" || err_exit 'typeset -pa does not list only index arrays' +$SHELL -c "$z; [[ \$(typeset -pa) == '$z' ]]" || err_exit 'typeset -pa does not list only indexed arrays' z='typeset -C z=(foo=bar)' $SHELL -c "$z; [[ \$(typeset -pC) == '$z' ]]" || err_exit 'typeset -pC does not list only compound variables' unset y diff --git a/src/cmd/ksh93/tests/bracket.sh b/src/cmd/ksh93/tests/bracket.sh index a9e4b6c38b99..20f9a2e43822 100755 --- a/src/cmd/ksh93/tests/bracket.sh +++ b/src/cmd/ksh93/tests/bracket.sh @@ -249,7 +249,7 @@ $SHELL -xc '[[ abc =~ \babc\b ]]' 2> /dev/null || err_exit '[[ abc =~ \babc\b ] e=$($SHELL -c '[ -z "" -a -z "" ]' 2>&1) [[ $e ]] && err_exit "[ ... ] compatibility check failed -- $e" i=hell -[[ hell0 == $i[0] ]] || err_exit 'pattern $i[0] interpreded as array ref' +[[ hell0 == $i[0] ]] || err_exit 'pattern $i[0] interpreted as array ref' test '(' = ')' && err_exit '"test ( = )" should not be true' [[ $($SHELL -c 'case F in ~(Eilr)[a-z0-9#]) print ok;;esac' 2> /dev/null) == ok ]] || err_exit '~(Eilr) not working in case command' [[ $($SHELL -c "case Q in ~(Fi)q | \$'\E') print ok;;esac" 2> /dev/null) == ok ]] || err_exit '~(Fi)q | \E not working in case command' diff --git a/src/cmd/ksh93/tests/builtins.sh b/src/cmd/ksh93/tests/builtins.sh index 1cc4b028c7bf..066900109997 100755 --- a/src/cmd/ksh93/tests/builtins.sh +++ b/src/cmd/ksh93/tests/builtins.sh @@ -84,7 +84,7 @@ hello \ world \ ! -[[ $REPLY == 'hello world' ]] || err_exit "read continuation2 failed" +[[ $REPLY == 'hello world' ]] || err_exit "read continuation 2 failed" print "one\ntwo" | { read line print $line | "$bincat" > /dev/null read line @@ -729,20 +729,20 @@ PATH=$tmp:$PATH $SHELL <<-\EOF || err_exit "'whence' gets wrong path on init" EOF # ====== -# `builtin -d` should not delete special builtins +# 'builtin -d' should not delete special builtins (builtin -d export 2> /dev/null PATH=/dev/null -whence -q export) || err_exit '`builtin -d` deletes special builtins' +whence -q export) || err_exit "'builtin -d' deletes special builtins" # ====== -# `read -r -d` should not ignore `-r` +# 'read -r -d' should not ignore '-r' printf '\\\000' | read -r -d '' [[ $REPLY == $'\\' ]] || err_exit "read -r -d '' ignores -r" # ====== -# Preceding a special builtin with `command` should disable its special properties +# Preceding a special builtin with 'command' should disable its special properties foo=BUG command eval ':' -[[ $foo == BUG ]] && err_exit '`command` fails to disable the special properties of special builtins' +[[ $foo == BUG ]] && err_exit "'command' fails to disable the special properties of special builtins" # ====== # 'whence -f' should ignore functions diff --git a/src/cmd/ksh93/tests/comvar.sh b/src/cmd/ksh93/tests/comvar.sh index 93331a788a47..5497ab5f9a5a 100755 --- a/src/cmd/ksh93/tests/comvar.sh +++ b/src/cmd/ksh93/tests/comvar.sh @@ -20,7 +20,7 @@ . "${SHTESTS_COMMON:-${0%/*}/_common}" -#test for compound variables +# regression tests for compound variables Command=${0##*/} integer Errors=0 Point=( @@ -209,7 +209,7 @@ unset z stack=() typeset -a stack.items=([0]=foo [1]=bar) [[ ${stack.items[0]} == foo ]] || err_exit 'typeset -a variable not expanding correctly' -$SHELL -c 'typeset -a info=( [1]=( passwd=( since=2005-07-20) ))' || err_exit 'problem with embedded index array in compound variable' +$SHELL -c 'typeset -a info=( [1]=( passwd=( since=2005-07-20) ))' || err_exit 'problem with embedded indexed array in compound variable' x=(foo=([1]=(y=([2]=(z=4))))) [[ $x == *'.y'=* ]] && err_exit 'expansion with bogus leading . in name' unset z @@ -453,7 +453,7 @@ typeset -C more_content=( ) mica01[4]+=more_content expected=$'typeset -C -a mica01=([4]=(a_string=\'foo bar\';some_stuff=hello))' -[[ $(typeset -p mica01) == "$expected" ]] || err_exit 'appened to indexed array compound variable not working' +[[ $(typeset -p mica01) == "$expected" ]] || err_exit 'append to indexed array compound variable not working' unset x compound x=( integer x= ; ) @@ -542,7 +542,7 @@ compound x=( ) ) expected='typeset -C x=(typeset -C -a nodes=([4]=());)' -[[ $(typeset -p x) == "$expected" ]] || err_exit 'typeset -p with nested compound index array not working' +[[ $(typeset -p x) == "$expected" ]] || err_exit 'typeset -p with nested compound indexed array not working' unset v compound v=( @@ -556,7 +556,7 @@ expected='typeset -C v=(typeset -A -l -i ar=([aa]=4 [bb]=9);)' unset x compound -a x x[1]=( a=1 b=2 ) -[[ $(print -v x[1]) == "${x[1]}" ]] || err_exit 'print -v x[1] not working for index array of compound variables' +[[ $(print -v x[1]) == "${x[1]}" ]] || err_exit 'print -v x[1] not working for indexed array of compound variables' unset x z='typeset -a x=(hello (x=12;y=5) world)' @@ -588,9 +588,9 @@ compound vx=( ) ) eval "vy=$(print -C vx)" -[[ $vx == "$vy" ]] || err_exit 'print -C with multi-dimensional array not working' +[[ $vx == "$vy" ]] || err_exit 'print -C with multidimensional array not working' eval "vy=$(print -v vx)" -[[ $vx == "$vy" ]] || err_exit 'print -v with multi-dimensional array not working' +[[ $vx == "$vy" ]] || err_exit 'print -v with multidimensional array not working' unset x typeset -C -A x=( [0]=(a=1) [1]=(b=2) ) diff --git a/src/cmd/ksh93/tests/enum.sh b/src/cmd/ksh93/tests/enum.sh index 4854bf6dabd3..f2cb142c91e7 100755 --- a/src/cmd/ksh93/tests/enum.sh +++ b/src/cmd/ksh93/tests/enum.sh @@ -56,7 +56,7 @@ done typeset -T X_t=( typeset name=aha ) typeset -a[X_t] arr ) 2> /dev/null -[[ $? == 1 ]] || err_exit 'typeset -a[X_t] should generate an error message when X-t is not an enumeriation type' +[[ $? == 1 ]] || err_exit 'typeset -a[X_t] should generate an error message when X-t is not an enumeration type' typeset -a [Color_t] arr arr[green]=foo diff --git a/src/cmd/ksh93/tests/exit.sh b/src/cmd/ksh93/tests/exit.sh index 8bc4316e697d..4cafe886d701 100755 --- a/src/cmd/ksh93/tests/exit.sh +++ b/src/cmd/ksh93/tests/exit.sh @@ -28,7 +28,7 @@ function abspath cd ~- print $newdir/$base } -#test for proper exit of shell +# test for proper exit of shell builtin getconf ABSHELL=$(abspath) print exit 0 >.profile diff --git a/src/cmd/ksh93/tests/heredoc.sh b/src/cmd/ksh93/tests/heredoc.sh index 87dac91ac5ff..d07c13e78c54 100755 --- a/src/cmd/ksh93/tests/heredoc.sh +++ b/src/cmd/ksh93/tests/heredoc.sh @@ -271,7 +271,7 @@ set -- $(wc < $tmpfile2) (( $1 == 1000 )) || err_exit "heredoc $1 lines, should be 1000 lines" (( $2 == 4000 )) || err_exit "heredoc $2 words, should be 4000 words" -# comment with here document looses line number count +# comment with here document loses line number count integer line=$((LINENO+5)) function tst { diff --git a/src/cmd/ksh93/tests/locale.sh b/src/cmd/ksh93/tests/locale.sh index 76061d26b700..645c718bf61e 100755 --- a/src/cmd/ksh93/tests/locale.sh +++ b/src/cmd/ksh93/tests/locale.sh @@ -380,4 +380,3 @@ fi # ====== exit $((Errors<125?Errors:125)) - diff --git a/src/cmd/ksh93/tests/nameref.sh b/src/cmd/ksh93/tests/nameref.sh index f967a19870ad..0cb5e44fae24 100755 --- a/src/cmd/ksh93/tests/nameref.sh +++ b/src/cmd/ksh93/tests/nameref.sh @@ -680,7 +680,7 @@ typeset +n ref unset ref ar typeset -a arr=( 1 2 3 ) typeset -n ref='arr[2]' -[[ $(typeset -p ref) == *'arr[2]'* ]] || err_exit 'typeset -p ref when ref is a reference to an index array element is wrong' +[[ $(typeset -p ref) == *'arr[2]'* ]] || err_exit 'typeset -p ref when ref is a reference to an indexed array element is wrong' $SHELL 2> /dev/null -c 'function x { nameref lv=gg ; compound -A lv.c=( [4]=( x=1 )) ; } ; compound gg ; x' || err_exit 'compound array assignment with nameref in a function failed' diff --git a/src/cmd/ksh93/tests/options.sh b/src/cmd/ksh93/tests/options.sh index 6205b9816e8c..fe0ceae24963 100755 --- a/src/cmd/ksh93/tests/options.sh +++ b/src/cmd/ksh93/tests/options.sh @@ -50,7 +50,7 @@ export ENV=/.$rc if [[ -o privileged ]] then [[ $(print env_hit | $SHELL 2>&1) == "OK" ]] && - err_exit 'privileged nointeractive shell reads $ENV file' + err_exit 'privileged noninteractive shell reads $ENV file' [[ $(print env_hit | $SHELL -E 2>&1) == "OK" ]] && err_exit 'privileged -E reads $ENV file' [[ $(print env_hit | $SHELL +E 2>&1) == "OK" ]] && @@ -61,7 +61,7 @@ then err_exit 'privileged --norc reads $ENV file' else [[ $(print env_hit | $SHELL 2>&1) == "OK" ]] && - err_exit 'nointeractive shell reads $ENV file' + err_exit 'noninteractive shell reads $ENV file' [[ $(print env_hit | $SHELL -E 2>&1) == "OK" ]] || err_exit '-E ignores $ENV file' [[ $(print env_hit | $SHELL +E 2>&1) == "OK" ]] && @@ -78,7 +78,7 @@ export ENV=/./dev/null if [[ -o privileged ]] then [[ $(print env_hit | HOME=$tmp $SHELL 2>&1) == "OK" ]] && - err_exit 'privileged nointeractive shell reads $HOME/.kshrc file' + err_exit 'privileged noninteractive shell reads $HOME/.kshrc file' [[ $(print env_hit | HOME=$tmp $SHELL -E 2>&1) == "OK" ]] && err_exit 'privileged -E ignores empty $ENV' [[ $(print env_hit | HOME=$tmp $SHELL +E 2>&1) == "OK" ]] && @@ -89,7 +89,7 @@ then err_exit 'privileged --norc reads $HOME/.kshrc file' else [[ $(print env_hit | HOME=$tmp $SHELL 2>&1) == "OK" ]] && - err_exit 'nointeractive shell reads $HOME/.kshrc file' + err_exit 'noninteractive shell reads $HOME/.kshrc file' [[ $(print env_hit | HOME=$tmp $SHELL -E 2>&1) == "OK" ]] && err_exit '-E ignores empty $ENV' [[ $(print env_hit | HOME=$tmp $SHELL +E 2>&1) == "OK" ]] && @@ -104,7 +104,7 @@ unset ENV if [[ -o privileged ]] then [[ $(print env_hit | HOME=$tmp $SHELL 2>&1) == "OK" ]] && - err_exit 'privileged nointeractive shell reads $HOME/.kshrc file' + err_exit 'privileged noninteractive shell reads $HOME/.kshrc file' [[ $(print env_hit | HOME=$tmp $SHELL -E 2>&1) == "OK" ]] && err_exit 'privileged -E reads $HOME/.kshrc file' [[ $(print env_hit | HOME=$tmp $SHELL +E 2>&1) == "OK" ]] && @@ -115,7 +115,7 @@ then err_exit 'privileged --norc reads $HOME/.kshrc file' else [[ $(print env_hit | HOME=$tmp $SHELL 2>&1) == "OK" ]] && - err_exit 'nointeractive shell reads $HOME/.kshrc file' + err_exit 'noninteractive shell reads $HOME/.kshrc file' [[ $(set +x; print env_hit | HOME=$tmp $SHELL -E 2>&1) == "OK" ]] || err_exit '-E ignores $HOME/.kshrc file' [[ $(print env_hit | HOME=$tmp $SHELL +E 2>&1) == "OK" ]] && diff --git a/src/cmd/ksh93/tests/path.sh b/src/cmd/ksh93/tests/path.sh index 59724918f231..b8aaf6777e9d 100755 --- a/src/cmd/ksh93/tests/path.sh +++ b/src/cmd/ksh93/tests/path.sh @@ -288,7 +288,7 @@ then PATH= fi unset PATH if [[ $(whence rm) != /*rm ]] - then err_exit 'unsetting path not working' + then err_exit 'unsetting PATH not working' fi fi PATH=/dev:$tmp @@ -442,7 +442,7 @@ print FPATH=../xxfun > $tmp/bin/.paths cp "$(whence -p echo)" $tmp/new/bin PATH=$tmp/bin:$tmp/new/bin:$PATH x=$(whence -p echo 2> /dev/null) -[[ $x == "$tmp/new/bin/echo" ]] || err_exit 'nonexistant FPATH directory in .paths file causes path search to fail' +[[ $x == "$tmp/new/bin/echo" ]] || err_exit 'nonexistent FPATH directory in .paths file causes path search to fail' $SHELL 2> /dev/null <<- \EOF || err_exit 'path search problem with non-existent directories in PATH' builtin getconf diff --git a/src/cmd/ksh93/tests/pointtype.sh b/src/cmd/ksh93/tests/pointtype.sh index d7bde8e4753c..4a8c0fe95ed6 100755 --- a/src/cmd/ksh93/tests/pointtype.sh +++ b/src/cmd/ksh93/tests/pointtype.sh @@ -115,7 +115,7 @@ A_t r r.b[1]=(y=2) r.b[2]=(y=5) eval s="$r" -[[ $r == "$s" ]] || err_exit 'expansion of type containing index array of types is incorrect' +[[ $r == "$s" ]] || err_exit 'expansion of type containing indexed array of types is incorrect' eval "$(typeset -p s)" [[ $y == "$z" ]] || err_exit 'typeset -p z for type containing index of types is incorrect' unset r s @@ -123,7 +123,7 @@ B_t r r.b[1]=(y=2) r.b[2]=(y=5) eval s="$r" -[[ $r == "$s" ]] || err_exit 'expansion of type containing index array of types is incorrect' +[[ $r == "$s" ]] || err_exit 'expansion of type containing indexed array of types is incorrect' eval "$(typeset -p s)" [[ $y == "$z" ]] || err_exit 'typeset -p z for type containing index of types is incorrect' diff --git a/src/cmd/ksh93/tests/quoting.sh b/src/cmd/ksh93/tests/quoting.sh index c66541434f7e..81391f80b55c 100755 --- a/src/cmd/ksh93/tests/quoting.sh +++ b/src/cmd/ksh93/tests/quoting.sh @@ -237,7 +237,7 @@ if [[ $(print -r s"!\2${x}\1\a!") != 's!\2\1\a!' ]] then err_exit 'print -r s"!\2${x}\1\a!" not equal s!\2\1\a!' fi if [[ $(print -r $'foo\n\n\n') != foo ]] -then err_exit 'trailing newlines on comsubstitution not removed' +then err_exit 'trailing newlines on command substitution not removed' fi unset x if [[ ${x:='//'} != '//' ]] diff --git a/src/cmd/ksh93/tests/readcsv.sh b/src/cmd/ksh93/tests/readcsv.sh index b7504de95f0c..59db8b4bb746 100755 --- a/src/cmd/ksh93/tests/readcsv.sh +++ b/src/cmd/ksh93/tests/readcsv.sh @@ -56,10 +56,9 @@ done diff "$tmp1" "$tmp2" >/dev/null 2>&1 || err_exit "files $tmp1 and $tmp2 differ" # ====== -# `read -S` should handle double quotes correctly +# 'read -S' should handle double quotes correctly IFS=',' read -S a b c <<<'foo,"""title"" data",bar' [[ $b == '"title" data' ]] || err_exit '"" inside "" not handled correctly with read -S' # ====== exit $((Errors<125?Errors:125)) - diff --git a/src/cmd/ksh93/tests/restricted.sh b/src/cmd/ksh93/tests/restricted.sh index e29f3d0e12d0..4f810b398bb0 100755 --- a/src/cmd/ksh93/tests/restricted.sh +++ b/src/cmd/ksh93/tests/restricted.sh @@ -70,9 +70,9 @@ do check_restricted "function foo { typeset $i=foobar;};foo" || err_exit "$i ca done # ====== -# `set +r` and `set +o restricted` should not unset the restricted option -check_restricted 'set +r' 2> /dev/null || err_exit '`set +r` unsets the restricted option' -check_restricted 'set +o restricted' 2> /dev/null || err_exit '`set +o restricted` unsets the restricted option' +# 'set +r' and 'set +o restricted' should not unset the restricted option +check_restricted 'set +r' 2> /dev/null || err_exit "'set +r' unsets the restricted option" +check_restricted 'set +o restricted' 2> /dev/null || err_exit "'set +o restricted' unsets the restricted option" # ====== exit $((Errors<125?Errors:125)) diff --git a/src/cmd/ksh93/tests/signal.sh b/src/cmd/ksh93/tests/signal.sh index 55483f66b9f4..3385d45274fa 100755 --- a/src/cmd/ksh93/tests/signal.sh +++ b/src/cmd/ksh93/tests/signal.sh @@ -380,7 +380,7 @@ x=$( print ok ++EOF ) -[[ $x == ok ]] || err_exit 'SIGPIPE exit status causes PIPE signal to be propogaged' +[[ $x == ok ]] || err_exit 'SIGPIPE exit status causes PIPE signal to be propagated' x=$( $SHELL <<- \EOF diff --git a/src/cmd/ksh93/tests/subshell.sh b/src/cmd/ksh93/tests/subshell.sh index aa1bc38ffac1..58df830209ba 100755 --- a/src/cmd/ksh93/tests/subshell.sh +++ b/src/cmd/ksh93/tests/subshell.sh @@ -58,7 +58,7 @@ val='( )' [[ $z == "$val" ]] || err_exit 'compound variable with mixed arrays not working' z.bar[1]=yesyes -[[ ${z.bar[1]} == yesyes ]] || err_exit 'reassign of index array compound variable fails' +[[ ${z.bar[1]} == yesyes ]] || err_exit 'reassign of indexed array compound variable fails' z.bar[1]=(x=12 y=5) [[ ${z.bar[1]} == $'(\n\tx=12\n\ty=5\n)' ]] || err_exit 'reassign array simple to compound variable fails' eval val="$z" @@ -72,7 +72,7 @@ eval val="$z" z.foo[two]=ok [[ ${z.foo[two]} == ok ]] || err_exit 'associative array assignment to compound variable in subshell not working' z.bar[1]=yes - [[ ${z.bar[1]} == yes ]] || err_exit 'index array assignment to compound variable in subshell not working' + [[ ${z.bar[1]} == yes ]] || err_exit 'indexed array assignment to compound variable in subshell not working' ) [[ $z == "$val" ]] || err_exit 'compound variable changes after associative array assignment' @@ -130,7 +130,7 @@ do $SHELL -c ' (( no == (BS * nb) )) || err_exit "shell hangs on command substitution output size >= $BS*$nb with write size $bs and trailing redirection -- expected $((BS*nb)), got ${no:-0}" done -# exercise command substitutuion trailing newline logic w.r.t. pipe vs. tmp file io +# exercise command substitution trailing newline logic w.r.t. pipe vs. tmp file io set -- \ 'post-line print' \ diff --git a/src/cmd/ksh93/tests/types.sh b/src/cmd/ksh93/tests/types.sh index cb386ba33787..573a1808fe86 100755 --- a/src/cmd/ksh93/tests/types.sh +++ b/src/cmd/ksh93/tests/types.sh @@ -501,9 +501,9 @@ fi { $SHELL -c '(sleep 3;kill $$)& typeset -T x=( typeset -a s );compound c;x c.i;c.i.s[7][5][3]=hello;x c.j=c.i;[[ ${c.i} == "${c.j}" ]]';} 2> /dev/null exitval=$? if [[ $(kill -l $exitval) == TERM ]] -then err_exit 'clone of multi-dimensional array timed out' +then err_exit 'clone of multidimensional array timed out' elif ((exitval)) -then err_exit "c.i and c.j are not the same multi-dimensional array" +then err_exit "c.i and c.j are not the same multidimensional array" fi typeset -T foobar_t=( diff --git a/src/lib/libast/README b/src/lib/libast/README index 19a72c1ac81f..68dd3420759b 100644 --- a/src/lib/libast/README +++ b/src/lib/libast/README @@ -30,7 +30,7 @@ hash: generic, scoped hash table support hashsize explicitly change table size (usually automatic) hashwalk apply function to each table entry memhash return hash code for n-char chunk of memory - strhash return hash code for null terminated string + strhash return hash code for null-terminated string include/ast: libast support headers diff --git a/src/lib/libast/RELEASE b/src/lib/libast/RELEASE index 8adeab885040..5413751af0b2 100644 --- a/src/lib/libast/RELEASE +++ b/src/lib/libast/RELEASE @@ -706,7 +706,7 @@ 03-09-23 modedata.c: table is for external modes, so no arch specific hacks optget.c: fix option prefix match translation bug optget.c: add ` =\n' to optstr() - features/lib: add memcmp() test for sgi optimzation bug + features/lib: add memcmp() test for sgi optimization bug 03-09-22 regex.h,regcomp.c: add regncomp() regclass.c: fix for loop dangling ; in regaddclass() 03-09-20 sftable.c,sfvprintf.c: fix SFFMT_CHAR handling to match extf api @@ -963,7 +963,7 @@ 02-06-27 ast_std.h: map _sysconf => _ast_sysconf for sun 02-06-26 cdt,sfio,vmalloc: kpv sync -- is this ever easy? 02-06-24 sfio: kpv sync, vfwscanf(),fputw() fix (wcslen(x)*sizeof(wchar_t)!!) - misc/fts.c: fix symlink chdir() optimzation bug + misc/fts.c: fix symlink chdir() optimization bug 02-06-11 sfio/sfwrite.c: string to file fix Makefile: __OBSOLETE__==20020101 02-06-01 regex/regcomp.c: REG_DELIMITED now consumes the delimiter @@ -1076,7 +1076,7 @@ misc/glob.c: fix \ trim() bug that restored / to wrong position string/fmtre.c: fix { ^ . $ } translations misc/optget.c: use original string if translation fails -- duh - sfio/sfhdr.h: assume assigns proper atttibutes to errno + sfio/sfhdr.h: assume assigns proper attributes to errno comp/regcmp.c: __ia64 workaround fixed by proper CC.DLL probe comp/getdate.c: __ia64 workaround fixed by proper CC.DLL probe features/lib: add lib getdate @@ -1090,7 +1090,7 @@ string/fmtmode.c: fix bug that omitted trailing '\0' 01-10-12 misc/optget.c: . => \&. for --??nroff comp/wc.c: fix mbstate_t initialization typo - features/float: fix max integer / float loop termiation + features/float: fix max integer / float loop termination features/float: fix LDBL_UINTMAX_MAX typo that did DBL_UINTMAX_MAX 01-10-11 include/sfio.h: fix _Sfstd* import/export features/common: fix _UWIN __DYNAMIC__() definition diff --git a/src/lib/libast/cdt/cdtlib.h b/src/lib/libast/cdt/cdtlib.h index 2539588b9fa1..7c0adbb250dc 100644 --- a/src/lib/libast/cdt/cdtlib.h +++ b/src/lib/libast/cdt/cdtlib.h @@ -134,7 +134,7 @@ typedef struct _dtlib_s (dt)->disc && (dt)->disc->eventf ) ? \ (*(dt)->disc->eventf)((dt), DT_ANNOUNCE|(ty), (ob), (dt)->disc) : 0 ) -/* map bits for upward compabitibility */ +/* map bits for upward compatibility */ #define DTTYPE(dt,ty) ((dt)->typef ? (*(dt)->typef)((dt), (ty)) : (ty) ) /* short-hands for fields in Dtlink_t. diff --git a/src/lib/libast/cdt/dtmethod.c b/src/lib/libast/cdt/dtmethod.c index 56a1d259242e..8aaa48d1f096 100644 --- a/src/lib/libast/cdt/dtmethod.c +++ b/src/lib/libast/cdt/dtmethod.c @@ -49,7 +49,7 @@ Dtmethod_t* meth; list = dtextract(dt); /* extract elements out of dictionary */ /* try to create internal structure for new method */ - if(dt->searchf == oldmt->searchf) /* ie, not viewpathing */ + if(dt->searchf == oldmt->searchf) /* i.e., not viewpathing */ dt->searchf = meth->searchf; dt->meth = meth; dt->data = NIL(Dtdata_t*); diff --git a/src/lib/libast/comp/iconv.c b/src/lib/libast/comp/iconv.c index e07fb644d19b..fb83172fbcdc 100644 --- a/src/lib/libast/comp/iconv.c +++ b/src/lib/libast/comp/iconv.c @@ -1107,7 +1107,7 @@ error(DEBUG_TRACE, "AHA#%d _ast_iconv_open f=%s:%s:%d t=%s:%s:%d\n", __LINE__, f cc->cvt = (iconv_t)(-1); /* - * 8 bit maps are the easiest + * 8-bit maps are the easiest */ if (fc >= 0 && tc >= 0) diff --git a/src/lib/libast/comp/setlocale.c b/src/lib/libast/comp/setlocale.c index 22c3401ecd44..cbb145dcefa9 100644 --- a/src/lib/libast/comp/setlocale.c +++ b/src/lib/libast/comp/setlocale.c @@ -199,7 +199,7 @@ native_setlocale(int category, const char* locale) /* * LC_COLLATE and LC_CTYPE debug support * - * mutibyte debug encoding + * multibyte debug encoding * * DL0 [ '0' .. '4' ] c1 ... c4 DR0 * DL1 [ '0' .. '4' ] c1 ... c4 DR1 diff --git a/src/lib/libast/comp/wordexp.c b/src/lib/libast/comp/wordexp.c index 33016dcda4a0..278c2b4d7744 100644 --- a/src/lib/libast/comp/wordexp.c +++ b/src/lib/libast/comp/wordexp.c @@ -34,8 +34,8 @@ struct list }; /* - * elimnates shell quoting as inserted with sh_fmtq - * result relaces + * eliminates shell quoting as inserted with sh_fmtq + * result replaces * length of resulting string is returned. */ static int sh_unquote(char* string) diff --git a/src/lib/libast/disc/memfatal.c b/src/lib/libast/disc/memfatal.c index 9016d36f98ae..a1d95599dcc2 100644 --- a/src/lib/libast/disc/memfatal.c +++ b/src/lib/libast/disc/memfatal.c @@ -59,7 +59,7 @@ nomalloc(Vmalloc_t* region, int type, void* obj, Vmdisc_t* disc) #endif case VM_NOMEM: vmstat(region, &st); - error(ERROR_SYSTEM|3, "storage allocator out of space on %lu byte request ( region %lu segments %lu busy %lu:%lu:%lu free %lu:%lu:%lu )", (size_t)obj, st.extent, st.n_seg, st.n_busy, st.s_busy, st.m_busy, st.n_free, st.s_free, st.m_free); + error(ERROR_SYSTEM|3, "storage allocator out of memory on %lu byte request ( region %lu segments %lu busy %lu:%lu:%lu free %lu:%lu:%lu )", (size_t)obj, st.extent, st.n_seg, st.n_busy, st.s_busy, st.m_busy, st.n_free, st.s_free, st.m_free); return(-1); } return(0); diff --git a/src/lib/libast/disc/sfdcdio.c b/src/lib/libast/disc/sfdcdio.c index f96771ffafa2..a4c5bed3c59a 100644 --- a/src/lib/libast/disc/sfdcdio.c +++ b/src/lib/libast/disc/sfdcdio.c @@ -88,7 +88,7 @@ int type; } if(done < n && (di->cntl & FDIRECT) ) - { /* turn off directIO for remaining IO operation */ + { /* turn off direct IO for remaining IO operation */ di->cntl &= ~FDIRECT; (void)fcntl(f->file, F_SETFL, di->cntl); } diff --git a/src/lib/libast/hash/strhash.c b/src/lib/libast/hash/strhash.c index e9f4976ccc0f..ca1ab0ca534b 100644 --- a/src/lib/libast/hash/strhash.c +++ b/src/lib/libast/hash/strhash.c @@ -30,7 +30,7 @@ #include "hashlib.h" /* - * return the hash of the null terminated string s + * return the hash of the null-terminated string s */ unsigned int diff --git a/src/lib/libast/include/ast.h b/src/lib/libast/include/ast.h index d41015b86d58..308d8f680b6f 100644 --- a/src/lib/libast/include/ast.h +++ b/src/lib/libast/include/ast.h @@ -176,7 +176,7 @@ typedef struct #define FMT_ALWAYS 0x01 /* always quote */ #define FMT_ESCAPED 0x02 /* already escaped */ #define FMT_SHELL 0x04 /* escape $ ` too */ -#define FMT_WIDE 0x08 /* don't escape 8 bit chars */ +#define FMT_WIDE 0x08 /* don't escape 8-bit chars */ #define FMT_PARAM 0x10 /* disable FMT_SHELL ${$( quote */ /* diff --git a/src/lib/libast/include/ls.h b/src/lib/libast/include/ls.h index fc1d62337823..b76fa623208e 100644 --- a/src/lib/libast/include/ls.h +++ b/src/lib/libast/include/ls.h @@ -35,7 +35,7 @@ #include /* - * some systems (could it beee AIX) pollute the std name space + * some systems (could be AIX) pollute the std name space */ #undef fileid diff --git a/src/lib/libast/include/regex.h b/src/lib/libast/include/regex.h index 7271abdaf8b4..18532446ba1d 100644 --- a/src/lib/libast/include/regex.h +++ b/src/lib/libast/include/regex.h @@ -118,7 +118,7 @@ #define REG_EBRACE 9 /* \{...\} or {...} imbalance */ #define REG_BADBR 10 /* invalid {...} digits */ #define REG_ERANGE 11 /* invalid [...] range endpoint */ -#define REG_ESPACE 12 /* out of space */ +#define REG_ESPACE 12 /* out of memory */ #define REG_BADRPT 13 /* unary op not preceded by re */ #define REG_ENULL 14 /* empty subexpr in pattern */ #define REG_ECOUNT 15 /* re component count overflow */ diff --git a/src/lib/libast/man/astsa.3 b/src/lib/libast/man/astsa.3 index 5b588a8ebeb0..8b5b0f9835dc 100644 --- a/src/lib/libast/man/astsa.3 +++ b/src/lib/libast/man/astsa.3 @@ -125,7 +125,7 @@ Returns the error message text corresponding to the .Ss "char* strerror(int \fIerrno\fP)" Equivalent to fmterror(\fIerrno\fP). .Ss "int strgrpmatch(const char* \fIstring\fP, const char* \fIpattern\fP, int* \fIsub\fP, int \fInsub\fP, int \fIflags\fP)" -Matches the null terminated \fIstring\fP against the null terminated +Matches the null-terminated \fIstring\fP against the null-terminated .BR ksh (1) augmented \fIpattern\fP. If \fIsub\fP!=0 then \fIsub\fP[2*\fIi\fP] is set to the start offset and \fIsub\fP[2*\fIi\fP+1] is set diff --git a/src/lib/libast/man/hash.3 b/src/lib/libast/man/hash.3 index 9d2869ac1592..626e5b7756da 100644 --- a/src/lib/libast/man/hash.3 +++ b/src/lib/libast/man/hash.3 @@ -592,7 +592,7 @@ Explicit calls to this routine are not necessary as hash tables are automatically resized. .TP .L "int strhash(char* name)" -Hashes the null terminated character string +Hashes the null-terminated character string .L name using a linear congruent pseudo-random number generator algorithm and returns a non-negative diff --git a/src/lib/libast/man/sfio.3 b/src/lib/libast/man/sfio.3 index 777c9fa52d74..0673b0d95b39 100644 --- a/src/lib/libast/man/sfio.3 +++ b/src/lib/libast/man/sfio.3 @@ -1545,7 +1545,7 @@ for indicating the type of a scanned element. For example, \f5%hd\fP means scanning a \f5short int\fP. The flags \f5ll\fP and \f5L\fP mean respectively scanning an integer or a floating point value with largest size -(i.e, \f5Sflong_t\fP or \f5Sfdouble_t\fP). +(i.e., \f5Sflong_t\fP or \f5Sfdouble_t\fP). .PP The \f5%i\fP, \f5%d\fP and \f5%u\fP patterns scan numbers in bases from \f52\fP to \f564\fP. diff --git a/src/lib/libast/man/strcopy.3 b/src/lib/libast/man/strcopy.3 index c08d885b2338..e0ba8f38ad5b 100644 --- a/src/lib/libast/man/strcopy.3 +++ b/src/lib/libast/man/strcopy.3 @@ -43,7 +43,7 @@ strcopy \- copy strings .L "char* strcopy(char* a, char* b)" .SH DESCRIPTION .I strcopy -copies the nul-terminated string +copies the null-terminated string .I b into .IR a . diff --git a/src/lib/libast/man/strdup.3 b/src/lib/libast/man/strdup.3 index 3b26ec4f239f..0c3ff74985f1 100644 --- a/src/lib/libast/man/strdup.3 +++ b/src/lib/libast/man/strdup.3 @@ -38,12 +38,12 @@ .. .TH STRDUP 3 .SH NAME -strdup \- duplicate nul-terminated string +strdup \- duplicate null-terminated string .SH SYNOPSIS .L "char* strdup(char* s)" .SH DESCRIPTION .I strdup -copies the nul-terminated string +copies the null-terminated string .I s to a new location provided by .IR malloc (3) diff --git a/src/lib/libast/man/stresc.3 b/src/lib/libast/man/stresc.3 index 468dec033669..d02f1b20914d 100644 --- a/src/lib/libast/man/stresc.3 +++ b/src/lib/libast/man/stresc.3 @@ -45,7 +45,7 @@ stresc \- convert character constants in string .I stresc converts .L \e -character constant expressions in the nul-terminated string +character constant expressions in the null-terminated string .I s in place and returns the length of the converted .IR s . diff --git a/src/lib/libast/man/streval.3 b/src/lib/libast/man/streval.3 index 2b491c859544..fe065ce57f3f 100644 --- a/src/lib/libast/man/streval.3 +++ b/src/lib/libast/man/streval.3 @@ -43,7 +43,7 @@ streval \- long integer arithmetic expression evaluator .L "long streval(char* s, char** e, long (*conv)(char* cs, char** ce))" .SH DESCRIPTION .I streval -evaluates the long integer arithmetic expression in the nul-terminated string +evaluates the long integer arithmetic expression in the null-terminated string .I s and returns the result. If diff --git a/src/lib/libast/man/stropt.3 b/src/lib/libast/man/stropt.3 index 212f140f42a9..5587daa85fa5 100644 --- a/src/lib/libast/man/stropt.3 +++ b/src/lib/libast/man/stropt.3 @@ -49,7 +49,7 @@ stropt \- table driven option expression evaluator .L " void* a)" .SH DESCRIPTION .I stropt -parses option expressions in the nul-terminated string +parses option expressions in the null-terminated string .I s using the option names in .IR tab . diff --git a/src/lib/libast/man/strperm.3 b/src/lib/libast/man/strperm.3 index ded96473d47d..7017c3b75e5b 100644 --- a/src/lib/libast/man/strperm.3 +++ b/src/lib/libast/man/strperm.3 @@ -43,7 +43,7 @@ strperm \- evaluate file permission expression .L "int strperm(char* s, char** e, int p)" .SH DESCRIPTION .I strperm -applies a file permission expression in the nul-terminated string +applies a file permission expression in the null-terminated string .I s to the initial file permission mask .IR p . diff --git a/src/lib/libast/man/strtape.3 b/src/lib/libast/man/strtape.3 index 8ed53587039e..fb2dc1968a9b 100644 --- a/src/lib/libast/man/strtape.3 +++ b/src/lib/libast/man/strtape.3 @@ -43,7 +43,7 @@ strtape \- convert string to tape device pathname .L "char* strtape(char* s, char** e)" .SH DESCRIPTION .I strtape -converts the generic tape device specification in the nul-terminated string +converts the generic tape device specification in the null-terminated string .I s to a local tape device pathname. A pointer to the device pathname is returned. diff --git a/src/lib/libast/man/strton.3 b/src/lib/libast/man/strton.3 index 52fa70d51198..650fa1d98f94 100644 --- a/src/lib/libast/man/strton.3 +++ b/src/lib/libast/man/strton.3 @@ -43,7 +43,7 @@ strton \- convert string to long integer .L "long strton(char* s, char** e)" .SH DESCRIPTION .I strton -converts the nul-terminated string +converts the null-terminated string .I s to a long integer. If diff --git a/src/lib/libast/misc/cmdarg.c b/src/lib/libast/misc/cmdarg.c index c6b99c8bca90..8f5f62eb68fa 100644 --- a/src/lib/libast/misc/cmdarg.c +++ b/src/lib/libast/misc/cmdarg.c @@ -149,7 +149,7 @@ cmdopen_20120411(char** argv, int argmax, int size, const char* argpat, Cmddisc_ if (!(cmd = newof(0, Cmdarg_t, 1, n + m))) { if (disc->errorf) - (*disc->errorf)(NiL, sh, ERROR_SYSTEM|2, "out of space"); + (*disc->errorf)(NiL, sh, ERROR_SYSTEM|2, "out of memory"); return 0; } cmd->id = lib; diff --git a/src/lib/libast/misc/fastfind.c b/src/lib/libast/misc/fastfind.c index c88840198f28..8321d7856407 100644 --- a/src/lib/libast/misc/fastfind.c +++ b/src/lib/libast/misc/fastfind.c @@ -159,7 +159,7 @@ findopen(const char* file, const char* pattern, const char* type, Finddisc_t* di if (!(vm = vmopen(Vmdcheap, Vmbest, 0))) - goto nospace; + goto nomemory; /* * NOTE: searching for FIND_CODES would be much simpler if we @@ -173,7 +173,7 @@ findopen(const char* file, const char* pattern, const char* type, Finddisc_t* di if (disc->flags & FIND_GENERATE) { if (!(fp = (Find_t*)vmnewof(vm, 0, Find_t, 1, sizeof(Encode_t) - sizeof(Code_t)))) - goto nospace; + goto nomemory; fp->vm = vm; fp->id = lib; fp->disc = disc; @@ -519,14 +519,14 @@ findopen(const char* file, const char* pattern, const char* type, Finddisc_t* di if (*(s = disc->dirs[i]) == '/') sfsprintf(b, sizeof(fp->decode.temp) - 1, "%s", s); else if (!p && !(p = getcwd(fp->decode.path, sizeof(fp->decode.path)))) - goto nospace; + goto nomemory; else sfsprintf(b, sizeof(fp->decode.temp) - 1, "%s/%s", p, s); s = pathcanon(b, sizeof(fp->decode.temp), 0); *s = '/'; *(s + 1) = 0; if (!(fp->dirs[q] = vmstrdup(fp->vm, b))) - goto nospace; + goto nomemory; if (j) (fp->dirs[q])[s - b] = 0; q++; @@ -537,7 +537,7 @@ findopen(const char* file, const char* pattern, const char* type, Finddisc_t* di if (!strneq(b, fp->dirs[q - 1], s - b)) { if (!(fp->dirs[q] = vmstrdup(fp->vm, b))) - goto nospace; + goto nomemory; if (j) (fp->dirs[q])[s - b] = 0; q++; @@ -647,9 +647,9 @@ findopen(const char* file, const char* pattern, const char* type, Finddisc_t* di } } return fp; - nospace: + nomemory: if (disc->errorf) - (*fp->disc->errorf)(fp, fp->disc, 2, "out of space"); + (*fp->disc->errorf)(fp, fp->disc, 2, "out of memory"); if (!vm) return 0; if (!fp) diff --git a/src/lib/libast/path/pathexists.c b/src/lib/libast/path/pathexists.c index 90b4ae70e4b5..c0c5277af4e3 100644 --- a/src/lib/libast/path/pathexists.c +++ b/src/lib/libast/path/pathexists.c @@ -24,7 +24,7 @@ * Glenn Fowler * AT&T Research * - * return 1 if path exisis + * return 1 if path exists * maintains a cache to minimize stat(2) calls * path is modified in-place but restored on return * path components checked in pairs to cut stat()'s diff --git a/src/lib/libast/port/astconf.c b/src/lib/libast/port/astconf.c index df4f5c8f8de8..4d9b83aac45e 100644 --- a/src/lib/libast/port/astconf.c +++ b/src/lib/libast/port/astconf.c @@ -813,7 +813,7 @@ feature(register Feature_t* fp, const char* name, const char* path, const char* if (!(fp = newof(0, Feature_t, 1, n + 1))) { if (conferror) - (*conferror)(&state, &state, 2, "%s: out of space", name); + (*conferror)(&state, &state, 2, "%s: out of memory", name); return 0; } fp->op = -1; diff --git a/src/lib/libast/port/lcgen.c b/src/lib/libast/port/lcgen.c index fddb024b315c..5f1e3e7d607e 100644 --- a/src/lib/libast/port/lcgen.c +++ b/src/lib/libast/port/lcgen.c @@ -421,7 +421,7 @@ char** argv; case CHARSET: if (!(cp = newof(0, Charset_t, 1, s - b + 1))) { - fprintf(stderr, "%s: %d: out of space\n", command, line); + fprintf(stderr, "%s: %d: out of memory\n", command, line); return 1; } b = (char*)(cp + 1); @@ -437,7 +437,7 @@ char** argv; case TERRITORY: if (!(tp = newof(0, Territory_t, 1, s - b + 1))) { - fprintf(stderr, "%s: %d: out of space\n", command, line); + fprintf(stderr, "%s: %d: out of memory\n", command, line); return 1; } b = (char*)(tp + 1); @@ -459,7 +459,7 @@ char** argv; } if (!(ll = newof(0, Language_list_t, 1, 0))) { - fprintf(stderr, "%s: %d: out of space\n", command, line); + fprintf(stderr, "%s: %d: out of memory\n", command, line); return 1; } if (!tp->languages) @@ -491,7 +491,7 @@ char** argv; case LANGUAGE: if (!(lp = newof(0, Language_t, 1, s - b + 1))) { - fprintf(stderr, "%s: %d: out of space\n", command, line); + fprintf(stderr, "%s: %d: out of memory\n", command, line); return 1; } b = (char*)(lp + 1); @@ -527,14 +527,14 @@ char** argv; fprintf(lf, "0,"); if (!(ap = newof(0, Attribute_t, 1, 0))) { - fprintf(stderr, "%s: %d: out of space\n", command, line); + fprintf(stderr, "%s: %d: out of memory\n", command, line); return 1; } ap->link.code = b; ap->link.index = i++; if (!(al = newof(0, Attribute_list_t, 1, 0))) { - fprintf(stderr, "%s: %d: out of space\n", command, line); + fprintf(stderr, "%s: %d: out of memory\n", command, line); return 1; } if (!lp->attributes) @@ -560,7 +560,7 @@ char** argv; case MAP: if (!(mp = newof(0, Map_t, 1, s - b + 1))) { - fprintf(stderr, "%s: %d: out of space\n", command, line); + fprintf(stderr, "%s: %d: out of memory\n", command, line); return 1; } b = (char*)(mp + 1); diff --git a/src/lib/libast/regex/regerror.c b/src/lib/libast/regex/regerror.c index 439230817a37..de0651fecd99 100644 --- a/src/lib/libast/regex/regerror.c +++ b/src/lib/libast/regex/regerror.c @@ -44,7 +44,7 @@ static const char* reg_error[] = /* REG_EBRACE */ "\\{...\\} or {...} imbalance", /* REG_BADBR */ "invalid {...} digits", /* REG_ERANGE */ "invalid [...] range endpoint", - /* REG_ESPACE */ "out of space", + /* REG_ESPACE */ "out of memory", /* REG_BADRPT */ "unary op not preceded by re", /* REG_ENULL */ "empty subexpr in pattern", /* REG_ECOUNT */ "re component count overflow", diff --git a/src/lib/libast/sfio/sfdisc.c b/src/lib/libast/sfio/sfdisc.c index 8ffc559f82a9..b3636d014def 100644 --- a/src/lib/libast/sfio/sfdisc.c +++ b/src/lib/libast/sfio/sfdisc.c @@ -30,7 +30,7 @@ ** consideration is stacking a discipline onto a read stream. Each ** discipline operation implies buffer synchronization so the stream ** buffer should be empty. However, a read stream representing an -** unseekable device (eg, a pipe) may not be synchronizable. In that +** unseekable device (e.g., a pipe) may not be synchronizable. In that ** case, any buffered data must then be fed to the new discipline ** to preserve data processing semantics. This is done by creating ** a temporary discipline to cache such buffered data and feed diff --git a/src/lib/libast/sfio/sfpkrd.c b/src/lib/libast/sfio/sfpkrd.c index 1295e5cd9352..e6a49e8ba553 100644 --- a/src/lib/libast/sfio/sfpkrd.c +++ b/src/lib/libast/sfio/sfpkrd.c @@ -54,7 +54,7 @@ size_t n; /* buffer size */ int rc; /* record character */ long tm; /* time-out */ int action; /* >0: peeking, if rc>=0, get action records, - <0: no peeking, if rc>=0, get -action records, + <0: no peeking, if rc>=0, get action records, =0: no peeking, if rc>=0, must get a single record =2: same as >0, but always use select(2) */ @@ -107,12 +107,12 @@ int action; /* >0: peeking, if rc>=0, get action records, break; } } -#endif /* stream_peek */ +#endif /* _stream_peek */ if(ntry == 1) break; - /* poll or select to see if data is present. */ + /* use select to see if data is present */ while(tm >= 0 || action > 0 || /* block until there is data before peeking again */ ((t&STREAM_PEEK) && rc >= 0) || diff --git a/src/lib/libast/sfio/sfpoll.c b/src/lib/libast/sfio/sfpoll.c index 3dd8f9d0080a..73b3aede4114 100644 --- a/src/lib/libast/sfio/sfpoll.c +++ b/src/lib/libast/sfio/sfpoll.c @@ -34,7 +34,7 @@ int sfpoll(Sfio_t** fa, reg int n, int tm) int sfpoll(fa, n, tm) Sfio_t** fa; /* array of streams to poll */ reg int n; /* number of streams in array */ -int tm; /* time in millisecs for select/poll */ +int tm; /* time in milliseconds for select/poll */ #endif { reg int r, c, m, np, eintr; diff --git a/src/lib/libast/sfio/sfseek.c b/src/lib/libast/sfio/sfseek.c index 1f446bae5500..b8d7ba2bd71e 100644 --- a/src/lib/libast/sfio/sfseek.c +++ b/src/lib/libast/sfio/sfseek.c @@ -203,7 +203,7 @@ int type; /* 0: from org, 1: from here, 2: from end */ #ifdef MAP_TYPE if(f->bits&SF_MMAP) - { /* if mmap is not great, stop mmaping if moving around too much */ + { /* if mmap is not great, stop mmapping if moving around too much */ #if _mmap_worthy < 2 if((f->next - f->data) < ((f->endb - f->data)/4) ) { SFSETBUF(f,(Void_t*)f->tiny,(size_t)SF_UNBOUND); diff --git a/src/lib/libast/sfio/sfsetbuf.c b/src/lib/libast/sfio/sfsetbuf.c index 58f854511f82..54111b54912c 100644 --- a/src/lib/libast/sfio/sfsetbuf.c +++ b/src/lib/libast/sfio/sfsetbuf.c @@ -410,7 +410,7 @@ size_t size; /* buffer size, -1 for default size */ _Sfi = f->val = obuf ? osize : 0; /* blksz is used for aligning disk block boundary while reading data to - ** optimize data transfer from disk (eg, via direct I/O). blksz can be + ** optimize data transfer from disk (e.g., via direct I/O). blksz can be ** at most f->size/2 so that data movement in buffer can be optimized. ** blksz should also be a power-of-2 for optimal disk seeks. */ diff --git a/src/lib/libast/sfio/sftmp.c b/src/lib/libast/sfio/sftmp.c index 051314f9b324..06b5b6bfe353 100644 --- a/src/lib/libast/sfio/sftmp.c +++ b/src/lib/libast/sfio/sftmp.c @@ -218,7 +218,7 @@ Sfio_t* f; # if defined(__linux__) && _lib_statfs /* * Use the area of POSIX shared memory objects for the new temporary file descriptor - * that is do not access HD or SSD but only the memory based tmpfs of the POSIX SHM + * that is do not access the HDD or SSD but only the memory based tmpfs of the POSIX SHM */ static int doshm; static char *shm = "/dev/shm"; diff --git a/src/lib/libast/string/tokline.c b/src/lib/libast/string/tokline.c index b572651a4b73..f690c581375e 100644 --- a/src/lib/libast/string/tokline.c +++ b/src/lib/libast/string/tokline.c @@ -148,7 +148,7 @@ spliceline(Sfio_t* s, int op, void* val, Sfdisc_t* ad) * * flags: 0 arg: open Sfio_t* * flags: SF_READ arg: file name - * flags: SF_STRING arg: null terminated char* + * flags: SF_STRING arg: null-terminated char* * * if line!=0 then it points to a line count that starts at 0 * and is incremented for each input line diff --git a/src/lib/libast/uwin/getpass.c b/src/lib/libast/uwin/getpass.c index bb65996d4aad..93d52a18993a 100644 --- a/src/lib/libast/uwin/getpass.c +++ b/src/lib/libast/uwin/getpass.c @@ -75,5 +75,4 @@ extern char* getpass(const char *prompt) return(cp?passwd:0); } - #endif diff --git a/src/lib/libast/vmalloc/vmlast.c b/src/lib/libast/vmalloc/vmlast.c index b60ea581468c..3617e077b081 100644 --- a/src/lib/libast/vmalloc/vmlast.c +++ b/src/lib/libast/vmalloc/vmlast.c @@ -27,7 +27,7 @@ void _STUB_vmlast(){} #include "vmhdr.h" -/* Allocation with freeing and reallocing of last allocated block only. +/* Allocation with freeing and reallocating of last allocated block only. ** ** Written by Kiem-Phong Vo, kpv@research.att.com, 01/16/94. */ diff --git a/src/lib/libcmd/RELEASE b/src/lib/libcmd/RELEASE index 26bdb1866e30..fc69ebd58475 100644 --- a/src/lib/libcmd/RELEASE +++ b/src/lib/libcmd/RELEASE @@ -53,7 +53,7 @@ 09-09-09 fds.c: add --unit=fd 09-08-25 tail.c: initialize Tail_t.fifo=0 !! 09-08-15 tail.c: fix fifo logic -09-08-11 wc.c: add setlocale(LC_CTYPE,"C") cleanup, add utf8 optimzations +09-08-11 wc.c: add setlocale(LC_CTYPE,"C") cleanup, add UTF-8 optimizations 09-08-10 uniq.c: replace -c 1..9999 sfsprintf() with inline conversion 09-08-01 join.c: fix empty field null pointer deref 09-07-23 pathchk.c: add -P,--path and -a,--all diff --git a/src/lib/libcmd/chgrp.c b/src/lib/libcmd/chgrp.c index 6fa3e446ba01..1fad5b17c6ec 100644 --- a/src/lib/libcmd/chgrp.c +++ b/src/lib/libcmd/chgrp.c @@ -286,7 +286,7 @@ b_chgrp(int argc, char** argv, Shbltin_t* context) mapdisc.key = offsetof(Map_t, key); mapdisc.size = sizeof(Key_t); if (!(map = dtopen(&mapdisc, Dtset))) - error(ERROR_exit(1), "out of space [id map]"); + error(ERROR_exit(1), "out of memory [id map]"); continue; case 'n': options |= OPT_SHOW; @@ -358,7 +358,7 @@ b_chgrp(int argc, char** argv, Shbltin_t* context) if (!(m = (Map_t*)dtmatch(map, &key))) { if (!(m = (Map_t*)stakalloc(sizeof(Map_t)))) - error(ERROR_exit(1), "out of space [id dictionary]"); + error(ERROR_exit(1), "out of memory [id dictionary]"); m->key = key; m->to.uid = m->to.gid = NOID; dtinsert(map, m); diff --git a/src/lib/libcmd/chmod.c b/src/lib/libcmd/chmod.c index 5234e82d3aa6..b0a8262c0f87 100644 --- a/src/lib/libcmd/chmod.c +++ b/src/lib/libcmd/chmod.c @@ -106,7 +106,7 @@ static const char usage[] = "[P:physical|nofollow?Don't follow symbolic links when traversing directories.]" "[R:recursive?Change the mode for files in subdirectories recursively.]" "[c:changes?Describe only files whose permission actually change.]" -"[f:quiet|silent?Do not report files whose permissioins fail to change.]" +"[f:quiet|silent?Do not report files whose permissions fail to change.]" "[h|l:symlink?Change the mode of symbolic links on systems that " "support \blchmod\b(2). Implies \b--physical\b.]" "[i:ignore-umask?Ignore the \bumask\b(2) value in symbolic mode " diff --git a/src/lib/libcmd/cp.c b/src/lib/libcmd/cp.c index d478d4dc7182..118ddaa32e4e 100644 --- a/src/lib/libcmd/cp.c +++ b/src/lib/libcmd/cp.c @@ -289,7 +289,7 @@ visit(State_t* state, register FTSENT* ent) if (state->directory) { if ((state->postsiz + len) > state->pathsiz && !(state->path = newof(state->path, char, state->pathsiz = roundof(state->postsiz + len, PATH_CHUNK), 0))) - error(ERROR_SYSTEM|3, "out of space"); + error(ERROR_SYSTEM|3, "out of memory"); if (state->hierarchy && ent->fts_level == 0 && strchr(base, '/')) { s = state->path + state->postsiz; @@ -688,7 +688,7 @@ b_cp(int argc, register char** argv, Shbltin_t* context) if (!(sh = CMD_CONTEXT(context)) || !(state = (State_t*)sh->ptr)) { if (!(state = newof(0, State_t, 1, 0))) - error(ERROR_SYSTEM|3, "out of space"); + error(ERROR_SYSTEM|3, "out of memory"); if (sh) sh->ptr = state; } @@ -873,7 +873,7 @@ b_cp(int argc, register char** argv, Shbltin_t* context) argv++; } if (!(v = (char**)stkalloc(stkstd, (argc + 2) * sizeof(char*)))) - error(ERROR_SYSTEM|3, "out of space"); + error(ERROR_SYSTEM|3, "out of memory"); memcpy(v, argv, (argc + 1) * sizeof(char*)); argv = v; if (!standard) @@ -960,7 +960,7 @@ b_cp(int argc, register char** argv, Shbltin_t* context) error(3, "%s: not a directory", file); state->postsiz = strlen(file); if (state->pathsiz < roundof(state->postsiz + 2, PATH_CHUNK) && !(state->path = newof(state->path, char, state->pathsiz = roundof(state->postsiz + 2, PATH_CHUNK), 0))) - error(ERROR_SYSTEM|3, "out of space"); + error(ERROR_SYSTEM|3, "out of memory"); memcpy(state->path, file, state->postsiz + 1); if (state->directory && state->path[state->postsiz - 1] != '/') state->path[state->postsiz++] = '/'; diff --git a/src/lib/libcmd/cut.c b/src/lib/libcmd/cut.c index 96571e3360a2..99b1c89e94e5 100644 --- a/src/lib/libcmd/cut.c +++ b/src/lib/libcmd/cut.c @@ -31,7 +31,7 @@ static const char usage[] = "[--catalog?" ERROR_CATALOG "]" "[+NAME?cut - cut out selected columns or fields of each line of a file]" "[+DESCRIPTION?\bcut\b bytes, characters, or character-delimited fields " - "from one or more files, contatenating them on standard output.]" + "from one or more files, concatenating them on standard output.]" "[+?The option argument \alist\a is a comma-separated or blank-separated " "list of positive numbers and ranges. Ranges can be of three " "forms. The first is two positive integers separated by a hyphen " @@ -52,7 +52,7 @@ static const char usage[] = "[d:delimiter]:[delim?The field character for the \b-f\b option is set " "to \adelim\a. The default is the \btab\b character.]" "[f:fields]:[list?\bcut\b based on fields separated by the delimiter " - "character specified with the \b-d\b optiion.]" + "character specified with the \b-d\b option.]" "[n!:split?Split multibyte characters selected by the \b-b\b option.]" "[R|r:reclen]#[reclen?If \areclen\a > 0, the input will be read as fixed length " "records of length \areclen\a when used with the \b-b\b or \b-c\b " @@ -60,7 +60,7 @@ static const char usage[] = "[s:suppress|only-delimited?Suppress lines with no delimiter characters, " "when used with the \b-f\b option. By default, lines with no " "delimiters will be passed in untouched.]" -"[D:line-delimeter|output-delimiter]:[ldelim?The line delimiter character for " +"[D:line-delimiter|output-delimiter]:[ldelim?The line delimiter character for " "the \b-f\b option is set to \aldelim\a. The default is the " "\bnewline\b character.]" "[N!:newline?Output new-lines at end of each record when used " @@ -138,7 +138,7 @@ cutinit(int mode, char* str, Delim_t* wdelim, Delim_t* ldelim, size_t reclen) Cut_t* cut; if (!(cut = (Cut_t*)stakalloc(sizeof(Cut_t) + strlen(cp) * sizeof(int)))) - error(ERROR_exit(1), "out of space"); + error(ERROR_exit(1), "out of memory"); if (cut->mb = mbwide()) { memset(cut->space, 0, sizeof(cut->space) / 2); diff --git a/src/lib/libcmd/date.c b/src/lib/libcmd/date.c index d1a472282b1b..be0685ba01e4 100644 --- a/src/lib/libcmd/date.c +++ b/src/lib/libcmd/date.c @@ -95,8 +95,8 @@ static const char usage[] = " [+d?day of month number]" " [+D?date as \amm/dd/yy\a]" " [+e?blank padded day of month number]" -" [+f?print a date with the format '\%Y.\%m.\%d-\%H:\%M:\%S']" -" [+F?%ISO 8601:2000 standard date format; equivalent to Y-%m-%d]" +" [+f?print a date with the format \b%Y.%m.%d-%H:%M:%S\b]" +" [+F?ISO 8601:2000 standard date format; equivalent to \b%Y-%m-%d\b]" " [+g?\bls\b(1) \b-l\b recent date with \ahh:mm\a]" " [+G?\bls\b(1) \b-l\b distant date with \ayyyy\a]" " [+h?abbreviated month name]" @@ -114,9 +114,10 @@ static const char usage[] = " [+n?newline character]" " [+N?nanoseconds 000000000-999999999]" " [+p?meridian (e.g., \bAM\b or \bPM\b)]" +" [+P?lowercase meridian (e.g., \bam\b or \bpm\b)]" " [+q?quarter of the year]" " [+Q?\arecentdistant\a: \a\a is a unique" -" delimter character; \arecent\a format for recent" +" delimiter character; \arecent\a format for recent" " dates, \adistant\a format otherwise]" " [+r?12-hour time as \ahh:mm:ss meridian\a]" " [+R?24-hour time as \ahh:mm\a]" @@ -344,7 +345,7 @@ b_date(int argc, register char** argv, Shbltin_t* context) continue; case 'p': if (!(f = newof(0, Fmt_t, 1, 0))) - error(ERROR_SYSTEM|3, "out of space [format]"); + error(ERROR_SYSTEM|3, "out of memory [format]"); f->next = fmts; f->format = opt_info.arg; fmts = f; diff --git a/src/lib/libcmd/head.c b/src/lib/libcmd/head.c index 9fb4cd890b9f..e03e98f11ea0 100644 --- a/src/lib/libcmd/head.c +++ b/src/lib/libcmd/head.c @@ -43,7 +43,7 @@ static const char usage[] = "other than a single byte:]" "{" "[+b?512 bytes.]" - "[+k?1-killobyte.]" + "[+k?1-kilobyte.]" "[+m?1-megabyte.]" "}" "[+?For backwards compatibility, \b-\b\anumber\a is equivalent to \b-n\b " diff --git a/src/lib/libcmd/id.c b/src/lib/libcmd/id.c index d2f62d2a8cd5..98b59485d406 100644 --- a/src/lib/libcmd/id.c +++ b/src/lib/libcmd/id.c @@ -232,7 +232,7 @@ getids(Sfio_t* sp, const char* name, register int flags) if ((maxgroups = getgroups(0, groups)) <= 0) maxgroups = NGROUPS_MAX; if (!(groups = newof(0, gid_t, maxgroups + 1, 0))) - error(ERROR_exit(1), "out of space [group array]"); + error(ERROR_exit(1), "out of memory [group array]"); } ngroups = getgroups(maxgroups, groups); for (i = j = 0; i < ngroups; i++) diff --git a/src/lib/libcmd/join.c b/src/lib/libcmd/join.c index 7b99ae337208..4c203a9761ae 100644 --- a/src/lib/libcmd/join.c +++ b/src/lib/libcmd/join.c @@ -704,7 +704,7 @@ sfprintf(sfstdout, "[2#%d:0,%lld,%lld]", __LINE__, lo, hi); jp->samesize = roundof(n2, 16); if (!(jp->same = newof(jp->same, char, jp->samesize, 0))) { - error(ERROR_SYSTEM|2, "out of space"); + error(ERROR_SYSTEM|2, "out of memory"); return -1; } } @@ -824,7 +824,7 @@ b_join(int argc, char** argv, Shbltin_t* context) cmdinit(argc, argv, context, ERROR_CATALOG, ERROR_NOTIFY); #endif if (!(jp = init())) - error(ERROR_system(1),"out of space"); + error(ERROR_system(1),"out of memory"); jp->context = context; for (;;) { diff --git a/src/lib/libcmd/logname.c b/src/lib/libcmd/logname.c index 982bac1447e5..81addf42133f 100644 --- a/src/lib/libcmd/logname.c +++ b/src/lib/libcmd/logname.c @@ -75,4 +75,3 @@ b_logname(int argc, char** argv, Shbltin_t* context) sfputr(sfstdout, logname, '\n'); return 0; } - diff --git a/src/lib/libcmd/mkfifo.c b/src/lib/libcmd/mkfifo.c index 701a7a87b1ed..a708ca3d3a8b 100644 --- a/src/lib/libcmd/mkfifo.c +++ b/src/lib/libcmd/mkfifo.c @@ -30,7 +30,7 @@ static const char usage[] = "[-?\n@(#)$Id: mkfifo (AT&T Research) 2009-01-02 $\n]" "[--catalog?" ERROR_CATALOG "]" "[+NAME?mkfifo - make FIFOs (named pipes)]" -"[+DESCRIPTION?\bmkfifo\b creates one or more FIFO's. By " +"[+DESCRIPTION?\bmkfifo\b creates one or more FIFOs. By " "default, the mode of created FIFO is \ba=rw\b minus the " "bits set in the \bumask\b(1).]" "[m:mode]:[mode?Set the mode of created FIFO to \amode\a. " @@ -40,8 +40,8 @@ static const char usage[] = "\nfile ...\n" "\n" "[+EXIT STATUS?]{" - "[+0?All FIFO's created successfully.]" - "[+>0?One or more FIFO's could not be created.]" + "[+0?All FIFOs created successfully.]" + "[+>0?One or more FIFOs could not be created.]" "}" "[+SEE ALSO?\bchmod\b(1), \bumask\b(1)]" ; diff --git a/src/lib/libcmd/mktemp.c b/src/lib/libcmd/mktemp.c index f77652b805cc..11fc974cde7e 100644 --- a/src/lib/libcmd/mktemp.c +++ b/src/lib/libcmd/mktemp.c @@ -109,7 +109,7 @@ b_mktemp(int argc, char** argv, Shbltin_t* context) continue; case 'R': if (!pathtemp(NiL, 0, opt_info.arg, "/seed", NiL)) - error(2, "%s: regression test initializtion failed", opt_info.arg); + error(2, "%s: regression test initialization failed", opt_info.arg); continue; case ':': error(2, "%s", opt_info.arg); diff --git a/src/lib/libcmd/paste.c b/src/lib/libcmd/paste.c index 192637b550ae..8d3b7c3a63ad 100644 --- a/src/lib/libcmd/paste.c +++ b/src/lib/libcmd/paste.c @@ -213,7 +213,7 @@ b_paste(int argc, char** argv, Shbltin_t* context) delim[1] = 0; } if (!(delim = strdup(delim))) - error(ERROR_system(1), "out of space"); + error(ERROR_system(1), "out of memory"); dlen = dsiz = stresc(delim); mp = 0; if (mbwide()) @@ -231,7 +231,7 @@ b_paste(int argc, char** argv, Shbltin_t* context) if (!(mp = newof(0, Delim_t, dlen, 0))) { free(delim); - error(ERROR_system(1), "out of space"); + error(ERROR_system(1), "out of memory"); } cp = delim; dlen = 0; @@ -254,7 +254,7 @@ b_paste(int argc, char** argv, Shbltin_t* context) if(!sflag) { if (!(streams = (Sfio_t**)stakalloc(n*sizeof(Sfio_t*)))) - error(ERROR_exit(1), "out of space"); + error(ERROR_exit(1), "out of memory"); n = 0; } do diff --git a/src/lib/libcmd/rev.c b/src/lib/libcmd/rev.c index 146d81bf8df5..e4294ec69d1e 100644 --- a/src/lib/libcmd/rev.c +++ b/src/lib/libcmd/rev.c @@ -76,7 +76,7 @@ static int rev_char(Sfio_t *in, Sfio_t *out) w = roundof(n + 1, 1024); if (!(wp = newof(wp, wchar_t, w, 0))) { - error(ERROR_SYSTEM|2, "out of space"); + error(ERROR_SYSTEM|2, "out of memory"); return 0; } } diff --git a/src/lib/libcmd/rmdir.c b/src/lib/libcmd/rmdir.c index 314bf1d2fb76..5aea6b20324e 100644 --- a/src/lib/libcmd/rmdir.c +++ b/src/lib/libcmd/rmdir.c @@ -123,4 +123,3 @@ b_rmdir(int argc, char** argv, Shbltin_t* context) } return(error_info.errors != 0); } - diff --git a/src/lib/libcmd/tail.c b/src/lib/libcmd/tail.c index 492faaea954e..a331afc9f7f7 100644 --- a/src/lib/libcmd/tail.c +++ b/src/lib/libcmd/tail.c @@ -611,7 +611,7 @@ b_tail(int argc, char** argv, Shbltin_t* context) if (flags & FOLLOW) { if (!(fp = (Tail_t*)stakalloc(argc * sizeof(Tail_t)))) - error(ERROR_system(1), "out of space"); + error(ERROR_system(1), "out of memory"); files = 0; s = *argv; do diff --git a/src/lib/libcmd/tee.c b/src/lib/libcmd/tee.c index 6630ba8deb37..8bd4ca86ef90 100644 --- a/src/lib/libcmd/tee.c +++ b/src/lib/libcmd/tee.c @@ -193,7 +193,7 @@ b_tee(int argc, register char** argv, Shbltin_t* context) } } else - error(ERROR_exit(0), "out of space"); + error(ERROR_exit(0), "out of memory"); } if ((sfmove(sfstdin, sfstdout, SF_UNBOUND, -1) < 0 || !sfeof(sfstdin)) && !ERROR_PIPE(errno) && errno != EINTR) error(ERROR_system(0), "read error"); diff --git a/src/lib/libcmd/uniq.c b/src/lib/libcmd/uniq.c index 523e94440af8..4e5c8ea50a14 100644 --- a/src/lib/libcmd/uniq.c +++ b/src/lib/libcmd/uniq.c @@ -339,4 +339,3 @@ b_uniq(int argc, char** argv, Shbltin_t* context) sfclose(fpout); return(error_info.errors); } - diff --git a/src/lib/libcmd/wc.c b/src/lib/libcmd/wc.c index 7296f7c3ea91..2d60bc358be5 100644 --- a/src/lib/libcmd/wc.c +++ b/src/lib/libcmd/wc.c @@ -53,7 +53,7 @@ static const char usage[] = "[L:longest-line|max-line-length?List the longest line length; the newline," "if any, is not counted in the length.]" "[N!:utf8?For \bUTF-8\b locales \b--noutf8\b disables \bUTF-8\b " - "optimzations and relies on the native \bmbtowc\b(3).]" + "optimizations and relies on the native \bmbtowc\b(3).]" "\n" "\n[file ...]\n" "\n" diff --git a/src/lib/libcmd/wclib.c b/src/lib/libcmd/wclib.c index 61efd176b07b..d1b47751c552 100644 --- a/src/lib/libcmd/wclib.c +++ b/src/lib/libcmd/wclib.c @@ -512,4 +512,3 @@ int wc_count(Wc_t *wp, Sfio_t *fd, const char* file) wp->lines = nlines; return 0; } - diff --git a/src/lib/libdll/dlfcn.c b/src/lib/libdll/dlfcn.c index 810be1b8169e..4fd986141e48 100644 --- a/src/lib/libdll/dlfcn.c +++ b/src/lib/libdll/dlfcn.c @@ -215,7 +215,7 @@ static const char id[] = "\n@(#)$Id: dll library (AT&T Research) 2010-10-20 $\0\ char *loc; /* the symbol name representation is a nuisance since * 8 character names appear in l_name but may - * not be null terminated. This code works around + * not be null-terminated. This code works around * that by brute force */ if (ldsym->l_zeroes) @@ -335,7 +335,7 @@ static const char id[] = "\n@(#)$Id: dll library (AT&T Research) 2010-10-20 $\0\ static const char e_cover[] = T("cannot access covered library"); static const char e_handle[] = T("invalid handle"); - static const char e_space[] = T("out of space"); + static const char e_nomemory[] = T("out of memory"); static const char e_static[] = T("image statically linked"); static const char e_undefined[] = T("undefined symbol"); @@ -382,7 +382,7 @@ static const char id[] = "\n@(#)$Id: dll library (AT&T Research) 2010-10-20 $\0\ dll = &global; else if (!(dll = newof(0, Dll_t, 1, strlen(path)))) { - dlmessage = e_space; + dlmessage = e_nomemory; return 0; } else diff --git a/src/lib/libdll/dllopen.c b/src/lib/libdll/dllopen.c index 0fac2d0b1c4b..557f3c15fba2 100644 --- a/src/lib/libdll/dllopen.c +++ b/src/lib/libdll/dllopen.c @@ -80,7 +80,7 @@ dllopen(const char* name, int mode) #else /* - * dlopen() wrapper -- waiting for prestidigitaions + * dlopen() wrapper -- waiting for prestidigitations */ void* diff --git a/src/lib/libsum/sum-sha2.c b/src/lib/libsum/sum-sha2.c index f7addf25aba4..0d43f46cb07d 100644 --- a/src/lib/libsum/sum-sha2.c +++ b/src/lib/libsum/sum-sha2.c @@ -40,7 +40,7 @@ * ASSERT NOTE: * Some sanity checking code is included using assert(). On my FreeBSD * system, this additional code can be removed by compiling with NDEBUG - * defined. Check your own systems manpage on assert() to see how to + * defined. Check your own systems man page on assert() to see how to * compile WITHOUT the sanity checking code on your system. * * UNROLLED TRANSFORM LOOP NOTE: @@ -118,7 +118,7 @@ typedef uint64_t sha2_word64; /* Exactly 8 bytes */ * Define the following sha2_* types to types of the correct length on * the native architecture. Most BSD systems and Linux define u_intXX_t * types. Machines with very recent ANSI C headers, can use the - * uintXX_t definintions from inttypes.h by defining SHA2_USE_INTTYPES_H + * uintXX_t definitions from inttypes.h by defining SHA2_USE_INTTYPES_H * during compile or in the sha.h header file. * * Machines that support neither u_intXX_t nor inttypes.h's uintXX_t