mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-13 11:42:21 +00:00
Fix various minor problems and update the documentation (#237)
These are minor fixes I've accumulated over time. The following
changes are somewhat notable:
- Added a missing entry for 'typeset -s' to the man page.
- Add strftime(3) to the 'see also' section. This and the date(1)
addition are meant to add onto the documentation for 'printf %T'.
- Removed the man page the entry for ksh reading $PWD/.profile on
login. That feature was removed in commit aa7713c2
.
- Added date(1) to the 'see also' section of the man page.
- Note that the 'hash' command can be used instead of 'alias -t' to
workaround one of the caveats listed in the man page.
- Use an 'out of memory' error message rather than 'out of space'
when memory allocation fails.
- Replaced backticks with quotes in some places for consistency.
- Added missing documentation for the %P date format.
- Added missing documentation for the printf %Q and %p formats
(backported from ksh2020: https://github.com/att/ast/pull/1032).
- The comments that show each builtin's options have been updated.
This commit is contained in:
parent
2d7e9a0d6d
commit
814b5c6890
151 changed files with 378 additions and 378 deletions
14
NEWS
14
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.
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ The development kit has three directories,
|
|||
It is best to set the value of the environment variable
|
||||
<TT>PACKAGE_ast</TT> to the pathname of the directory
|
||||
containing the development kit.
|
||||
The <TT>include</TT> directory contains a sub-directory
|
||||
The <TT>include</TT> directory contains a subdirectory
|
||||
named <TT>ast</TT> that contains interface prototypes
|
||||
for functions that you can call from built-ins. The <TT>lib</TT>
|
||||
directory contains the <TT>ast</TT> library
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) = '/';
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -282,4 +282,3 @@ int b_alarm(int argc,char *argv[],Shbltin_t *context)
|
|||
nv_putval(np, argv[1], 0);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -254,4 +254,3 @@ int b_pwd(int argc, char *argv[],Shbltin_t *context)
|
|||
sfputr(sfstdout,cp,'\n');
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -117,4 +117,3 @@ int b_break(register int n, register char *argv[],Shbltin_t *context)
|
|||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
@ -571,4 +576,3 @@ int b_universe(int argc, char *argv[],Shbltin_t *context)
|
|||
return(0);
|
||||
}
|
||||
#endif /* cmd_universe */
|
||||
|
||||
|
|
|
@ -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 <cp>
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
|
|
@ -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)
|
|||
* <names> is an array of variable names
|
||||
* <fd> is the file descriptor
|
||||
* <flags> is union of -A, -r, -s, and contains delimiter if not '\n'
|
||||
* <timeout> is number of milli-seconds until timeout
|
||||
* <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 @@ done:
|
|||
siglongjmp(*shp->jmplist,jmpval);
|
||||
return(jmpval);
|
||||
}
|
||||
|
||||
|
|
|
@ -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. "
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* sleep delay
|
||||
* sleep [-s] duration
|
||||
*
|
||||
* David Korn
|
||||
* AT&T Labs
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -22,10 +22,16 @@
|
|||
* export [-p] [arg...]
|
||||
* readonly [-p] [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);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* ulimit [-HSacdfmnstuv] [limit]
|
||||
* ulimit [-HSaMctdfxlqenupmrbiswTv] [limit]
|
||||
*
|
||||
* David Korn
|
||||
* AT&T Labs
|
||||
|
|
|
@ -95,4 +95,3 @@ int b_umask(int argc,char *argv[],Shbltin_t *context)
|
|||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ The development kit has three directories,
|
|||
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
|
||||
|
|
|
@ -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?\a<del>recent<del>distant<del>\a: \a<del>\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]"
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#pragma prototyped
|
||||
|
||||
/*
|
||||
* tables for the test builin [[...]] and [...]
|
||||
* tables for the test builtin [[...]] and [...]
|
||||
*/
|
||||
|
||||
#include <ast.h>
|
||||
|
|
|
@ -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 <off> in the physical buffer
|
||||
* if <cur> is non-zero and <= <off>, then correspodning <curpos> will start the search
|
||||
* if <cur> is non-zero and <= <off>, then corresponding <curpos> will start the search
|
||||
*/
|
||||
Edpos_t ed_curpos(Edit_t *ep,genchar *phys, int off, int cur, Edpos_t curpos)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -200,7 +200,7 @@ done:
|
|||
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};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -210,4 +210,3 @@ extern const char sh_optwhence[];
|
|||
extern const char sh_opttimes[];
|
||||
|
||||
extern const char e_dict[];
|
||||
|
||||
|
|
|
@ -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 ((...)) */ \
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -189,5 +189,4 @@ extern void job_chldtrap(Shell_t*, const char*,int);
|
|||
# define job_fork(p)
|
||||
#endif /* JOBS */
|
||||
|
||||
|
||||
#endif /* !JOB_NFLAG */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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" ;;
|
||||
|
|
|
@ -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),
|
||||
|
@ -8553,6 +8568,7 @@ sysconf(2),
|
|||
umask(2),
|
||||
ulimit(2),
|
||||
wait(2),
|
||||
strftime(3),
|
||||
wctrans(3),
|
||||
rand(3),
|
||||
a.out(5),
|
||||
|
@ -8574,6 +8590,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\^
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -814,4 +814,3 @@ static int arg_expand(Shell_t *shp,register struct argnod *argp, struct argnod *
|
|||
}
|
||||
return(count);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,4 +45,3 @@ char *sh_lexstates[ST_NONE] = {0};
|
|||
|
||||
struct jobs job = {0};
|
||||
int32_t sh_mailchk = 600;
|
||||
|
||||
|
|
|
@ -588,4 +588,3 @@ static void here_body(register const struct ionod *iop)
|
|||
sfclose(infile);
|
||||
sfputr(outfile,iop->iodelim,'\n');
|
||||
}
|
||||
|
||||
|
|
|
@ -681,4 +681,3 @@ void sh_done(void *ptr, register int sig)
|
|||
|
||||
exit(savxit&SH_EXITMASK);
|
||||
}
|
||||
|
||||
|
|
|
@ -167,4 +167,3 @@ int _fcmbget(short *len)
|
|||
}
|
||||
return(c);
|
||||
}
|
||||
|
||||
|
|
|
@ -221,7 +221,7 @@ static int rand_shift;
|
|||
/*
|
||||
* out of memory routine for stak routines
|
||||
*/
|
||||
static char *nospace(int unused)
|
||||
static char *nomemory(int unused)
|
||||
{
|
||||
NOT_USED(unused);
|
||||
errormsg(SH_DICT, ERROR_SYSTEM|ERROR_PANIC, "out of memory");
|
||||
|
@ -236,7 +236,7 @@ void *sh_malloc(size_t size)
|
|||
{
|
||||
void *cp = malloc(size);
|
||||
if(!cp)
|
||||
nospace(0);
|
||||
nomemory(0);
|
||||
return(cp);
|
||||
}
|
||||
|
||||
|
@ -244,7 +244,7 @@ void *sh_realloc(void *ptr, size_t size)
|
|||
{
|
||||
void *cp = realloc(ptr, size);
|
||||
if(!cp)
|
||||
nospace(0);
|
||||
nomemory(0);
|
||||
return(cp);
|
||||
}
|
||||
|
||||
|
@ -252,7 +252,7 @@ void *sh_calloc(size_t nmemb, size_t size)
|
|||
{
|
||||
void *cp = calloc(nmemb, size);
|
||||
if(!cp)
|
||||
nospace(0);
|
||||
nomemory(0);
|
||||
return(cp);
|
||||
}
|
||||
|
||||
|
@ -260,7 +260,7 @@ char *sh_strdup(const char *s)
|
|||
{
|
||||
char *dup = strdup(s);
|
||||
if(!dup)
|
||||
nospace(0);
|
||||
nomemory(0);
|
||||
return(dup);
|
||||
}
|
||||
|
||||
|
@ -268,7 +268,7 @@ void *sh_memdup(const void *s, size_t n)
|
|||
{
|
||||
void *dup = memdup(s, n);
|
||||
if(!dup)
|
||||
nospace(0);
|
||||
nomemory(0);
|
||||
return(dup);
|
||||
}
|
||||
|
||||
|
@ -1319,7 +1319,7 @@ Shell_t *sh_init(register int argc,register char *argv[], Shinit_f userinit)
|
|||
sh_ioinit(shp);
|
||||
/* initialize signal handling */
|
||||
sh_siginit(shp);
|
||||
stakinstall(NIL(Stak_t*),nospace);
|
||||
stakinstall(NIL(Stak_t*),nomemory);
|
||||
/* set up memory for name-value pairs */
|
||||
shp->init_context = nv_init(shp);
|
||||
/* initialize shell type */
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -1975,4 +1975,3 @@ void job_fork(pid_t parent)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ struct adata
|
|||
short numnodes;
|
||||
short maxnodes;
|
||||
};
|
||||
#endif /*SHOPT_TYPEDEF */
|
||||
#endif /* SHOPT_TYPEDEF */
|
||||
|
||||
#if NVCACHE
|
||||
struct Namcache
|
||||
|
@ -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)))
|
||||
|
|
|
@ -909,7 +909,7 @@ void clone_all_disc( Namval_t *np, Namval_t *mp, int flags)
|
|||
* NV_APPEND - append <np> onto <mp>
|
||||
* NV_MOVE - move <np> to <mp>
|
||||
* 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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
/*
|
||||
* Table lookup routine
|
||||
* <table> is searched for string <sp> 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 <str> 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 <str> 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
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
||||
|
|
|
@ -242,4 +242,3 @@ void timerdel(void *handle)
|
|||
signal(SIGALRM,(sh.sigflag[SIGALRM]&SH_SIGFAULT)?sh_fault:SIG_DFL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 )) */
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) )
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -380,4 +380,3 @@ fi
|
|||
|
||||
# ======
|
||||
exit $((Errors<125?Errors:125))
|
||||
|
||||
|
|
|
@ -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'
|
||||
|
||||
|
|
|
@ -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" ]] &&
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
||||
|
|
|
@ -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:='//'} != '//' ]]
|
||||
|
|
|
@ -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))
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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' \
|
||||
|
|
|
@ -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=(
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 `<length> <name>=<value>\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 <errno.h> assigns proper atttibutes to errno
|
||||
sfio/sfhdr.h: assume <errno.h> 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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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*);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -34,8 +34,8 @@ struct list
|
|||
};
|
||||
|
||||
/*
|
||||
* elimnates shell quoting as inserted with sh_fmtq
|
||||
* result relaces <string>
|
||||
* eliminates shell quoting as inserted with sh_fmtq
|
||||
* result replaces <string>
|
||||
* length of resulting string is returned.
|
||||
*/
|
||||
static int sh_unquote(char* string)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 */
|
||||
|
||||
/*
|
||||
|
|
|
@ -130,7 +130,7 @@ struct _glob_
|
|||
/* error return values */
|
||||
#define GLOB_ABORTED 1
|
||||
#define GLOB_NOMATCH 2
|
||||
#define GLOB_NOSPACE 3
|
||||
#define GLOB_NOSPACE 3 /* note: this error is for ENOMEM */
|
||||
#define GLOB_INTR 4
|
||||
#define GLOB_APPERR 5
|
||||
#define GLOB_NOSYS 6
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include <ast_mode.h>
|
||||
|
||||
/*
|
||||
* some systems (could it beee AIX) pollute the std name space
|
||||
* some systems (could be AIX) pollute the std name space
|
||||
*/
|
||||
|
||||
#undef fileid
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue