On 6/30/06, Martin Schaffstall <martin.schaffstall at googlemail.com> wrote:
> On 6/30/06, Glenn Fowler <gsf at research.att.com> wrote:
> >
> > this update contains the latest changes
> > including tab-tab updates that will hopefully make everyone happy
> > dgk and I will be on sporadically for the next two weeks
> >
> >   http://www.research.att.com/~gsf/download/alpha/INIT.2006-06-30.md5
> >   http://www.research.att.com/~gsf/download/alpha/INIT.2006-06-30.tgz
> >   http://www.research.att.com/~gsf/download/alpha/ast-ksh.2006-06-30.md5
> >   http://www.research.att.com/~gsf/download/alpha/ast-ksh.2006-06-30.tgz
>
> Can anyone post a diff for the changes between 2006-06-16 and this
> source drop, pls?
patch diff attached
-- 
      _        Felix Schulte
    _|_|_     mailto:felix.schulte at gmail.com
    (0 0)
ooO--(_)--Ooo
-------------- next part --------------
diff -r -N -u ksh93_2006_06_16/lib/package/ast-ksh.html 
ksh93_2006_06_30/lib/package/ast-ksh.html
--- ksh93_2006_06_16/lib/package/ast-ksh.html   2006-06-16 11:07:12.000000000 
+0200
+++ ksh93_2006_06_30/lib/package/ast-ksh.html   2006-06-30 15:38:18.000000000 
+0200
@@ -192,7 +192,15 @@
 <P><HR><CENTER><FONT color=red><FONT face=courier><H3><A name="ksh93 
changes">ksh93 changes</A></H3></FONT></FONT></CENTER>
 <PRE>
 
-06-06-13  --- Release ksh93r+  ---
+06-06-23  --- Release ksh93r+  ---
+06-06-23  A number of bug fixes for  command, file, and variable completion
+         have been mode.
+06-06-20  Floating point division by zero now yields the constant Inf or -Inf
+         and floating functions with invalid arguments yield NaN. 
+06-06-20  The floating point constants Inf and NaN can be used in arithmetic
+         expressions.
+06-06-20  The functions isinf(), isnan(), tanhl() have been added for
+         arithmetic expressions.
 06-06-13  Internal change to use ordering for variables instead of hashing
          to speed up prefix matching.
 06-06-13  A window between fork/exec in which a signal could get lost
@@ -1540,9 +1548,15 @@
 <P><HR><CENTER><FONT color=red><FONT face=courier><H3><A name="libast 
changes">libast changes</A></H3></FONT></FONT></CENTER>
 <PRE>
 
+06-06-27 features/float,sfio/sfcvt.c: fix Nan logic
+06-06-27 port/astmath.c: fix long double isnan() test
+06-06-27 features/map.c: _map_libc for std =&gt; _ast_std
+06-06-25 string/strperm.c: handle posix = w.r.t. umask
+06-06-19 port/mnt.c,features/fs: handle netbsd getmntent api change
+06-06-18 regex/regstat.c: add REG_LITERAL check
 06-06-11 cdt/dtview.c: update from kpv
 06-05-31 sfio/sfhdr.h: fix _SFOPEN() typo
-06-05-09 comp/comf.sh: add native getconf -a names to the mix
+06-05-09 comp/conf.sh: add native getconf -a names to the mix
 06-04-28 misc/optget.c: add solaris long option name compatibility
 06-03-09 string/strmatch.c: add REG_ADVANCE =&gt; REG_* flags
 06-02-14 comp/iconv.c: fix uwin iconv_list() /reg/ generator
@@ -2847,6 +2861,7 @@
 <P><HR><CENTER><FONT color=red><FONT face=courier><H3><A name="libcmd 
changes">libcmd changes</A></H3></FONT></FONT></CENTER>
 <PRE>
 
+06-06-25 chmod.c: mask -c output with S_IPERM
 06-05-09 uname.c: add -o; change -a to match linux
 06-05-03 date.c: add --last -L to list last of multiple time args
 06-02-14 tail.c: fix -f bug that lost fast stream data
@@ -3069,7 +3084,7 @@
 <TR>
 <TD align=left></TD>
 <TD align=center></TD>
-<TD align=right>June 16, 2006</TD>
+<TD align=right>June 30, 2006</TD>
 </TR>
 </TABLE>
 <P>
diff -r -N -u ksh93_2006_06_16/lib/package/ast-ksh.README 
ksh93_2006_06_30/lib/package/ast-ksh.README
--- ksh93_2006_06_16/lib/package/ast-ksh.README 2006-06-16 11:07:06.000000000 
+0200
+++ ksh93_2006_06_30/lib/package/ast-ksh.README 2006-06-30 15:38:11.000000000 
+0200
@@ -89,7 +89,15 @@
 
 :::::::: ksh93 ::::::::
 
-06-06-13  --- Release ksh93r+  ---
+06-06-23  --- Release ksh93r+  ---
+06-06-23  A number of bug fixes for  command, file, and variable completion
+         have been mode.
+06-06-20  Floating point division by zero now yields the constant Inf or -Inf
+         and floating functions with invalid arguments yield NaN. 
+06-06-20  The floating point constants Inf and NaN can be used in arithmetic
+         expressions.
+06-06-20  The functions isinf(), isnan(), tanhl() have been added for
+         arithmetic expressions.
 06-06-13  Internal change to use ordering for variables instead of hashing
          to speed up prefix matching.
 06-06-13  A window between fork/exec in which a signal could get lost
@@ -1434,9 +1442,15 @@
 
 :::::::: libast ::::::::
 
+06-06-27 features/float,sfio/sfcvt.c: fix Nan logic
+06-06-27 port/astmath.c: fix long double isnan() test
+06-06-27 features/map.c: _map_libc for std => _ast_std
+06-06-25 string/strperm.c: handle posix = w.r.t. umask
+06-06-19 port/mnt.c,features/fs: handle netbsd getmntent api change
+06-06-18 regex/regstat.c: add REG_LITERAL check
 06-06-11 cdt/dtview.c: update from kpv
 06-05-31 sfio/sfhdr.h: fix _SFOPEN() typo
-06-05-09 comp/comf.sh: add native getconf -a names to the mix
+06-05-09 comp/conf.sh: add native getconf -a names to the mix
 06-04-28 misc/optget.c: add solaris long option name compatibility
 06-03-09 string/strmatch.c: add REG_ADVANCE => REG_* flags
 06-02-14 comp/iconv.c: fix uwin iconv_list() /reg/ generator
@@ -2738,6 +2752,7 @@
 
 :::::::: libcmd ::::::::
 
+06-06-25 chmod.c: mask -c output with S_IPERM
 06-05-09 uname.c: add -o; change -a to match linux
 06-05-03 date.c: add --last -L to list last of multiple time args
 06-02-14 tail.c: fix -f bug that lost fast stream data
diff -r -N -u ksh93_2006_06_16/lib/package/ast-ksh.ver 
ksh93_2006_06_30/lib/package/ast-ksh.ver
--- ksh93_2006_06_16/lib/package/ast-ksh.ver    2006-06-16 11:07:01.000000000 
+0200
+++ ksh93_2006_06_30/lib/package/ast-ksh.ver    2006-06-30 15:38:08.000000000 
+0200
@@ -1 +1 @@
-ast-ksh 2006-06-16 2006-06-16 1
+ast-ksh 2006-06-30 2006-06-30 1
diff -r -N -u ksh93_2006_06_16/README ksh93_2006_06_30/README
--- ksh93_2006_06_16/README     2006-06-16 11:07:01.000000000 +0200
+++ ksh93_2006_06_30/README     2006-06-30 15:38:08.000000000 +0200
@@ -3,7 +3,7 @@
 
        bin/package
 
-Binary files me be in this directory or in the install root directory
+Binary files may be in this directory or in the install root directory
 
        INSTALLROOT=$PACKAGEROOT/arch/`bin/package`
 
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/data/builtins.c 
ksh93_2006_06_30/src/cmd/ksh93/data/builtins.c
--- ksh93_2006_06_16/src/cmd/ksh93/data/builtins.c      2006-06-08 
00:19:31.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/data/builtins.c      2006-06-22 
00:06:43.000000000 +0200
@@ -1577,7 +1577,7 @@
 "[f?Each of the options and \aname\as refers to a function.]"
 "[i]#?[base:=10?An integer. \abase\a represents the arithmetic base "
        "from 2 to 64.]"
-"[l?Convert uppercase character to lowercase.  Unsets \b-u\b attribute.  When"
+"[l?Convert uppercase character to lowercase.  Unsets \b-u\b attribute.  When "
        "used with \b-i\b, \b-E\b, or \b-F\b indicates long variant.]"
 "[n?Name reference.  The value is the name of a variable that \aname\a "
        "references.  \aname\a cannot contain a \b.\b.]"
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/data/msg.c 
ksh93_2006_06_30/src/cmd/ksh93/data/msg.c
--- ksh93_2006_06_16/src/cmd/ksh93/data/msg.c   2005-11-23 16:53:16.000000000 
+0100
+++ ksh93_2006_06_30/src/cmd/ksh93/data/msg.c   2006-06-21 23:40:08.000000000 
+0200
@@ -95,10 +95,12 @@
 const char e_aliname[]         = "%s: invalid alias name";
 const char e_badexport[]       = "%s: invalid export name";
 const char e_badref[]          = "%s: reference variable cannot be an array";
+const char e_noarray[]         = "%s: cannot be an array";
 const char e_noref[]           = "%s: no reference name";
 const char e_selfref[]         = "%s: invalid self reference";
 const char e_noalias[]         = "%s: alias not found\n";
 const char e_format[]          = "%s: bad format";
+const char e_redef[]           = "%s: type cannot be redefined";
 const char e_badtformat[]      = "%c: bad format character in time format";
 const char e_nolabels[]                = "%s: label not implemented";
 const char e_notimp[]          = "%s: not implemented";
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/data/strdata.c 
ksh93_2006_06_30/src/cmd/ksh93/data/strdata.c
--- ksh93_2006_06_16/src/cmd/ksh93/data/strdata.c       2005-05-25 
06:32:01.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/data/strdata.c       2006-06-26 
23:17:32.000000000 +0200
@@ -106,6 +106,7 @@
 #endif
 
 typedef Sfdouble_t (*mathf)(Sfdouble_t,...);
+typedef int (*mathif)(Sfdouble_t);
 
 #ifdef _ast_fltmax_double
 
@@ -117,8 +118,12 @@
 #   define     cosl    cos
 #   define     coshl   cosh
 #   define     expl    exp
+#   define     finitel finite
 #   define     fmodl   fmod
 #   define     hypotl  hypot
+#   define     isinfl  isinf
+#   define     isnanl  isnan
+#   define     isnormall       isnormal
 #   define     floorl  floor
 #   define     logl    log
 #   define     powl    pow
@@ -128,7 +133,7 @@
 #   define     tanl    tan
 #   define     tanhl   tanh
 
-#else
+#endif
 
 #ifdef __STDARG__
 #   define fundef(name)                static _ast_fltmax_t 
local_##name(_ast_fltmax_t d){ return(name(d));}
@@ -150,7 +155,7 @@
 {
 #endif
 
-#if defined(acosl) || !defined(_lib_acosl)
+#if defined(acosl) || !_lib_acosl
 #   ifndef acosl
 #       define acosl(x) macdef(acos,x)
 #   endif
@@ -158,12 +163,12 @@
 #   undef acosl
 #   define acosl local_acosl
 #else
-#   if defined(_npt_acosl)
+#   if _npt_acosl
        protodef(acosl)
 #   endif
 #endif 
 
-#if defined(asinl) || !defined(_lib_asinl)
+#if defined(asinl) || !_lib_asinl
 #   ifndef asinl
 #       define asinl(x) macdef(asin,x)
 #   endif
@@ -171,12 +176,12 @@
 #   undef asinl
 #   define asinl local_asinl
 #else
-#   if defined(_npt_asinl)
+#   if _npt_asinl
        protodef(asinl)
 #   endif
 #endif 
 
-#if defined(atanl) || !defined(_lib_atanl)
+#if defined(atanl) || !_lib_atanl
 #   ifndef atanl
 #       define atanl(x) macdef(atan,x)
 #   endif
@@ -184,12 +189,12 @@
 #   undef atanl
 #   define atanl local_atanl
 #else
-#   if defined(_npt_atanl)
+#   if _npt_atanl
        protodef(atanl)
 #   endif
 #endif 
 
-#if defined(atan2l) || !defined(_lib_atan2l)
+#if defined(atan2l) || !_lib_atan2l
 #   ifndef atan2l
 #       define atan2l(x,y) macdef2(atan2,x,y)
 #   endif
@@ -197,12 +202,12 @@
 #   undef atan2l
 #   define atan2l local_atan2l
 #else
-#   if defined(_npt_atan2l)
+#   if _npt_atan2l
        protodef2(atan2l)
 #   endif
 #endif 
 
-#if defined(expl) || !defined(_lib_expl)
+#if defined(expl) || !_lib_expl
 #   ifndef expl
 #       define expl(x) macdef(exp,x)
 #   endif
@@ -210,12 +215,12 @@
 #   undef expl
 #   define expl local_expl
 #else
-#   if defined(_npt_expl)
+#   if _npt_expl
        protodef(expl)
 #   endif
 #endif 
 
-#if defined(cosl) || !defined(_lib_cosl)
+#if defined(cosl) || !_lib_cosl
 #   ifndef cosl
 #       define cosl(x) macdef(cos,x)
 #   endif
@@ -223,12 +228,12 @@
 #   undef cosl
 #   define cosl local_cosl
 #else
-#   if defined(_npt_cosl)
+#   if _npt_cosl
        protodef(cosl)
 #   endif
 #endif 
 
-#if defined(coshl) || !defined(_lib_coshl)
+#if defined(coshl) || !_lib_coshl
 #   ifndef coshl
 #       define coshl(x) macdef(cosh,x)
 #   endif
@@ -236,12 +241,12 @@
 #   undef coshl
 #   define coshl local_coshl
 #else
-#   if defined(_npt_coshl)
+#   if _npt_coshl
        protodef(coshl)
 #   endif
 #endif 
 
-#if defined(hypotl) || !defined(_lib_hypotl)
+#if defined(hypotl) || !_lib_hypotl
 #   ifndef hypotl
 #       define hypotl(x,y) macdef2(hypot,x,y)
 #   endif
@@ -249,12 +254,49 @@
 #   undef hypotl
 #   define hypotl local_hypotl
 #else
-#   if defined(_npt_hypotl)
+#   if _npt_hypotl
        protodef2(hypotl)
 #   endif
 #endif 
 
-#if defined(floorl) || !defined(_lib_floorl)
+#if defined(finitel) || !_lib_finitel
+#   ifndef finitel
+#       define finitel(x) macdef(finite,x)
+#   endif
+#   ifdef _lib_finitel
+       fundef(finitel)
+#   else
+#       ifdef __STDARG__
+       static int local_finitel(_ast_fltmax_t d)
+#       else
+       static int local_finitel(d)
+       _ast_fltmax_t d;
+#       endif
+       {
+#     if _lib_isfinite
+           return(isfinite(d));
+#     else
+#       if _lib_isinfl
+           return(!isinfl(d) && !isnan(d));
+#       else
+#         if _lib_isinf
+           return(!isinf(d) && !isnan(d));
+#         else
+           return(!isnan(d));
+#         endif
+#       endif
+#     endif
+       }
+#   endif
+#   undef finitel
+#   define finitel local_finitel
+#else
+#   if _npt_finitel
+       protodef(finitel)
+#   endif
+#endif 
+
+#if defined(floorl) || !_lib_floorl
 #   ifndef floorl
 #       define floorl(x) macdef(floor,x)
 #   endif
@@ -262,12 +304,12 @@
 #   undef floorl
 #   define floorl local_floorl
 #else
-#   if defined(_npt_floorl)
+#   if _npt_floorl
        protodef(floorl)
 #   endif
 #endif 
 
-#if defined(fmodl) || !defined(_lib_fmodl)
+#if defined(fmodl) || !_lib_fmodl
 #   ifndef fmodl
 #       define fmodl(x,y) macdef2(fmod,x,y)
 #   endif
@@ -275,12 +317,63 @@
 #   undef fmodl
 #   define fmodl local_fmodl
 #else
-#   if defined(_npt_fmodl)
+#   if _npt_fmodl
        protodef2(fmodl)
 #   endif
 #endif 
 
-#if defined(logl) || !defined(_lib_logl)
+#if defined(isinfl) || !_lib_isinfl
+#   ifndef isinfl
+#       define isinfl(x) macdef(isinf,x)
+#   endif
+#   ifdef _lib_isinf
+       fundef(isinfl)
+#   else
+#       ifdef __STDARG__
+       static int local_isinfl(_ast_fltmax_t d)
+#       else
+       static int local_isinfl(d)
+       _ast_fltmax_t d;
+#       endif
+       { return(!finitel(d) && !isnan(d)); }
+#   endif
+#   undef isinfl
+#   define isinfl local_isinfl
+#else
+#   if _npt_isinfl
+       protodef(isinfl)
+#   endif
+#endif 
+
+#if defined(isnanl) || !_lib_isnanl
+#   ifndef isnanl
+#       define isnanl(x) macdef(isnan,x)
+#   endif
+    fundef(isnanl)
+#   undef isnanl
+#   define isnanl local_isnanl
+#else
+#   if _npt_isnanl
+       protodef(isnanl)
+#   endif
+#endif 
+
+#if defined(isnormall) || !_lib_isnormall
+#   ifndef isnormall
+#       define isnormall(x) macdef(isnormal,x)
+#   endif
+#   ifdef _lib_isnormal
+       fundef(isnormall)
+#   endif
+#   undef isnormall
+#   define isnormall local_isnormall
+#else
+#   if _npt_isnormall
+       protodef(isnormall)
+#   endif
+#endif 
+
+#if defined(logl) || !_lib_logl
 #   ifndef logl
 #       define logl(x) macdef(log,x)
 #   endif
@@ -288,12 +381,12 @@
 #   undef logl
 #   define logl local_logl
 #else
-#   if defined(_npt_logl)
+#   if _npt_logl
        protodef(logl)
 #   endif
 #endif 
 
-#if defined(sinl) || !defined(_lib_sinl)
+#if defined(sinl) || !_lib_sinl
 #   ifndef sinl
 #       define sinl(x) macdef(sin,x)
 #   endif
@@ -301,12 +394,12 @@
 #   undef sinl
 #   define sinl local_sinl
 #else
-#   if defined(_npt_sinl)
+#   if _npt_sinl
        protodef(sinl)
 #   endif
 #endif 
 
-#if defined(sinhl) || !defined(_lib_sinhl)
+#if defined(sinhl) || !_lib_sinhl
 #   ifndef sinhl
 #       define sinhl(x) macdef(sinh,x)
 #   endif
@@ -314,12 +407,12 @@
 #   undef sinhl
 #   define sinhl local_sinhl
 #else
-#   if defined(_npt_sinhl)
+#   if _npt_sinhl
        protodef(sinhl)
 #   endif
 #endif 
 
-#if defined(sqrtl) || !defined(_lib_sqrtl)
+#if defined(sqrtl) || !_lib_sqrtl
 #   ifndef sqrtl
 #       define sqrtl(x) macdef(sqrt,x)
 #   endif
@@ -327,12 +420,12 @@
 #   undef sqrtl
 #   define sqrtl local_sqrtl
 #else
-#   if defined(_npt_sqrtl)
+#   if _npt_sqrtl
        protodef(sqrtl)
 #   endif
 #endif 
 
-#if defined(tanl) || !defined(_lib_tanl)
+#if defined(tanl) || !_lib_tanl
 #   ifndef tanl
 #       define tanl(x) macdef(tan,x)
 #   endif
@@ -340,12 +433,12 @@
 #   undef tanl
 #   define tanl local_tanl
 #else
-#   if defined(_npt_tanl)
+#   if _npt_tanl
        protodef(tanl)
 #   endif
 #endif 
 
-#if defined(tanhl) || !defined(_lib_tanhl)
+#if defined(tanhl) || !_lib_tanhl
 #   ifndef tanhl
 #       define tanhl(x) macdef(tanh,x)
 #   endif
@@ -353,12 +446,12 @@
 #   undef tanhl
 #   define tanhl local_tanhl
 #else
-#   if defined(_npt_tanhl)
+#   if _npt_tanhl
        protodef(tanhl)
 #   endif
 #endif 
 
-#if defined(powl) || !defined(_lib_powl)
+#if defined(powl) || !_lib_powl
 #   ifndef powl
 #       define powl(x,y) macdef2(pow,x,y)
 #   endif
@@ -366,12 +459,12 @@
 #   undef powl
 #   define powl local_powl
 #else
-#   if defined(_npt_powl)
+#   if _npt_powl
        protodef2(powl)
 #   endif
 #endif 
 
-#if defined(fabsl) || !defined(_lib_fabsl)
+#if defined(fabsl) || !_lib_fabsl
 #   ifndef fabsl
 #       define fabsl(x) macdef(fabs,x)
 #   endif
@@ -379,19 +472,19 @@
 #   undef fabsl
 #   define fabsl local_fabsl
 #else
-#   if defined(_npt_fabsl)
+#   if _npt_fabsl
        protodef(fabsl)
 #   endif
 #endif 
 
-
 #if 0 /* proto bug workaround */
 }
 #endif
 
-#endif
-
-
+/*
+ * first byte is two-digit octal number.  Last digit is number of args
+ * first digit is 0 if return value is double, 1 for integer
+ */
 const struct mathtab shtab_math[] =
 {
        "\01abs",               (mathf)fabsl,
@@ -402,10 +495,16 @@
        "\01cos",               (mathf)cosl,
        "\01cosh",              (mathf)coshl,
        "\01exp",               (mathf)expl,
+       "\011finite",           (mathf)finitel,
        "\01floor",             (mathf)floorl,
        "\02fmod",              (mathf)fmodl,
        "\02hypot",             (mathf)hypotl,
        "\01int",               (mathf)floorl,
+       "\011isinf",            (mathf)isinfl,
+       "\011isnan",            (mathf)isnanl,
+#ifdef _lib_isnormal
+       "\011isnormal",         (mathf)isnormall,
+#endif
        "\01log",               (mathf)logl,
        "\02pow",               (mathf)powl,
        "\01sin",               (mathf)sinl,
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/edit/completion.c 
ksh93_2006_06_30/src/cmd/ksh93/edit/completion.c
--- ksh93_2006_06_16/src/cmd/ksh93/edit/completion.c    2006-06-14 
05:02:38.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/edit/completion.c    2006-06-26 
00:46:00.000000000 +0200
@@ -25,6 +25,7 @@
 
 #include       "defs.h"
 #include       <ctype.h>
+#include       <ast_wchar.h>
 #include       "lexstates.h"
 #include       "path.h"
 #include       "io.h"
@@ -60,20 +61,87 @@
        return(str);
 }
 
+
 /*
- * returns 1 if the quote at *out is an open quote, 0 otherwise
+ * returns pointer to beginning of expansion and sets type of expansion
  */
-static int openq(char *outbuff, char *out)
+static char *find_begin(char outbuff[], char *last, int endchar, int *type)
 {
-       register int quote= *out, c, count=1;
-       while(outbuff < out)
+       register char   *cp=outbuff, *bp, *xp;
+       register int    c,inquote = 0;
+       bp = outbuff;
+       *type = 0;
+       while(cp < last)
        {
-               if((c= *outbuff++)=='\\' && quote=='"')
-                       continue;
-               if(c==quote)
-                       count = !count;
+               xp = cp;
+               switch(c= mbchar(cp))
+               {
+                   case '\'': case '"':
+                       if(!inquote)
+                       {
+                               inquote = c;
+                               bp = xp;
+                               break;
+                       }
+                       if(inquote==c)
+                               inquote = 0;
+                       break;
+                   case '\\':
+                       if(inquote != '\'')
+                               mbchar(cp);
+                       break;
+                   case '$':
+                       if(inquote == '\'')
+                               break;
+                       c = *(unsigned char*)cp;
+                       if(isaletter(c) || c=='{')
+                       {
+                               int dot = '.';
+                               if(c=='{')
+                               {
+                                       xp = cp;
+                                       mbchar(cp);
+                                       c = *(unsigned char*)cp;
+                                       if(c!='.' && !isaletter(c))
+                                               break;
+                               }
+                               else
+                                       dot = 'a';
+                               while(cp < last)
+                               {
+                                       if((c= mbchar(cp)) , c!=dot && 
!isaname(c))
+                                               break;
+                               }
+                               if(cp>=last)
+                               {
+                                       *type='$';
+                                       return(++xp);
+                               }
+                       }
+                       else if(c=='(')
+                       {
+                               xp = find_begin(cp,last,')',type);
+                               if(*(cp=xp)!=')')
+                                       bp = xp;
+                               else
+                                       cp++;
+                       }
+                       break;
+                   case '=':
+                       if(!inquote)
+                               bp = cp;
+                       break;
+                   default:
+                       if(c && c==endchar)
+                               return(xp);
+                       if(!inquote && ismeta(c))
+                               bp = cp;
+                       break;
+               }
        }
-       return(count);
+       if(inquote && *bp==inquote)
+               *type = *bp++;
+       return(bp);
 }
 
 /*
@@ -87,17 +155,12 @@
 
 int ed_expand(Edit_t *ep, char outbuff[],int *cur,int *eol,int mode, int count)
 {
-       struct comnod  *comptr;
-       struct argnod *ap;
-       register char *out;
-       char *av[2];
-       char *begin;
-       char *dir = 0;
-       int addstar;
-       int rval = 0;
-       int strip;
-       int var=0;
-       int nomarkdirs = !sh_isoption(SH_MARKDIRS);
+       struct comnod   *comptr;
+       struct argnod   *ap;
+       register char   *out;
+       char            *av[2], *begin , *dir=0;
+       int             addstar=0, rval=0, var=0, strip=1;
+       int             nomarkdirs = !sh_isoption(SH_MARKDIRS);
        sh_onstate(SH_FCOMPLETE);
        if(ep->e_nlist)
        {
@@ -130,7 +193,7 @@
                *eol = ed_external((genchar*)outbuff,outbuff);
        }
 #endif /* SHOPT_MULTIBYTE */
-       out = outbuff + *cur;
+       out = outbuff + *cur + (sh_isoption(SH_VI)!=0);
        comptr->comtyp = COMSCAN;
        comptr->comarg = ap;
        ap->argflag = (ARG_MAC|ARG_EXP);
@@ -140,105 +203,47 @@
                register int c;
                char *last = out;
                c =  *(unsigned char*)out;
-               var = isaname(c);
-               if(out>outbuff)
+               begin = out = find_begin(outbuff,last,0,&var);
+               /* addstar set to zero if * should not be added */
+               if(var=='$')
                {
-                       /* go to beginning of word */
-                       if(ep->e_nlist)
-                               out++;
-                       if(((c= *out--)=='\'' || c=='"') && 
!openq(outbuff,out+1))
-                       {
-                               int q = out[1];
-                               var = 0;
-                               do
-                               {
-                                       c = *(unsigned char*)--out;
-                               }
-                               while(out>outbuff &&  c!=q && c!='=');
-                               out--;
-                       }
-                       else while(1)
-                       {
-                               c = *(unsigned char*)out;
-                               if(c=='$' && var==1)
-                               {
-                                       var = *((unsigned char*)&out[1]);
-                                       var= 2*isaletter(var);
-                               }
-                               else if(var==2)
-                               {
-                                       if(c!='"')
-                                               var++;
-                               }
-                               else if(!isaname(c))
-                                       var = 0;
-                               if(out <= outbuff)
-                                       break;
-                               if(*--out!='\\' && (ismeta(c) || c=='`' || 
c=='='))
-                               {
-                                       out++;
-                                       c = out[1];
-                                       /* special handling for leading quote */
-                                       if((c=='\'' || c=='"') && 
openq(outbuff,out))
-                                               out+=2;
-                                       break;
-                               }
-                       }
-                       if(*out==' ' || *out=='\t')
-                               out++;
+                       stakputs("${!");
+                       stakwrite(out,last-out);
+                       stakputs("@}");
+                       out = last;
                }
                else
-                       out = outbuff;
-               begin = out;
-               /* addstar set to zero if * should not be added */
-               addstar = '*';
-               strip = 1;
-               var = var==3;
-               if(var)
                {
-                       stakputs("${!");
-                       addstar = 0;
-                       if(*out++=='"')
+                       addstar = '*';
+                       while(out < last)
                        {
-                               var=2;
+                               c = *(unsigned char*)out;
+                               if(isexp(c))
+                                       addstar = 0;
+                               if (c == '/')
+                               {
+                                       if(addstar == 0)
+                                               strip = 0;
+                                       dir = out+1;
+                               }
+                               stakputc(c);
                                out++;
                        }
-
                }
-               /* copy word to arg */
-               do
-               {
-                       c = *(unsigned char*)out;
-                       if(isexp(c))
-                               addstar = 0;
-                       if (c == '/')
-                       {
-                               if(addstar == 0)
-                                       strip = 0;
-                               dir = out+1;
-                       }
-                       if(var && c==0)
-                               stakputs("@}");
-                       stakputc(c);
-                       out++;
-
-               } while (out<last ||  (c && !ismeta(c) && c!='`'));
-               out--;
-               if(!var && mode=='\\')
+               if(var!='$' && mode=='\\' && out[-1]!='*')
                        addstar = '*';
                if(*begin=='~' && !strchr(begin,'/'))
                        addstar = 0;
-               *stakptr(staktell()-1) = addstar;
+               stakputc(addstar);
                stakfreeze(1);
        }
        if(mode!='*')
                sh_onoption(SH_MARKDIRS);
        {
-               register char **com;
-               char    *cp=begin;
-               char    *left=0;
-               int      narg,cmd_completion=0;
-               register int size='x';
+               register char   **com;
+               char            *cp=begin, *left=0, *saveout=".";
+               int             nocase=0,narg,cmd_completion=0;
+               register        int size='x';
                while(cp>outbuff && ((size=cp[-1])==' ' || size=='\t'))
                        cp--;
                if(!var && !strchr(ap->argval,'/') && 
(((cp==outbuff&&sh.nextprompt==1) || (strchr(";&|(",size)) && 
(cp==outbuff+1||size=='('||cp[-2]!='>') && *begin!='~' )))
@@ -254,7 +259,12 @@
                                begin += (dir-begin);
                }
                else
+               {
                        com = sh_argbuild(&narg,comptr,0);
+                       /* special handling for leading quotes */
+                       if(begin>outbuff && (begin[-1]=='"' || begin[-1]=='\''))
+                       begin--;
+               }
                sh_offstate(SH_COMPLETE);
                 /* allow a search to be aborted */
                if(sh.trapnote&SH_SIGSET)
@@ -263,14 +273,11 @@
                        goto done;
                }
                /*  match? */
-               if (*com==0 || (narg <= 1 && strcmp(ap->argval,*com)==0))
+               if (*com==0 || (narg <= 1 && (strcmp(ap->argval,*com)==0) || 
(addstar && com[0][strlen(*com)-1]=='*')))
                {
                        rval = -1;
                        goto done;
                }
-               /* special handling for leading quotes */
-               if(begin>outbuff && (begin[-1]=='"' || begin[-1]=='\''))
-                       begin--;
                if(mode=='=')
                {
                        if (strip && !cmd_completion)
@@ -291,8 +298,19 @@
                size = *eol - (out-begin);
                if(mode=='\\')
                {
+                       int c;
+                       if(dir)
+                       {
+                               c = *dir;
+                               *dir = 0;
+                               saveout = begin;
+                       }
+                       if(saveout=astconf("PATH_ATTRIBUTES",saveout,(char*)0))
+                               nocase = (strchr(saveout,'c')!=0);
+                       if(dir)
+                               *dir = c;
                        /* just expand until name is unique */
-                       size += var+strlen(*com);
+                       size += strlen(*com);
                }
                else
                {
@@ -300,7 +318,7 @@
                        {
                                char **savcom = com;
                                while (*com)
-                                       size += var+strlen(sh_fmtq(*com++));
+                                       size += strlen(cp=sh_fmtq(*com++));
                                com = savcom;
                        }
                }
@@ -313,33 +331,28 @@
                /* save remainder of the buffer */
                if(*out)
                        left=stakcopy(out);
-               if(var)
-               {
-                       if(var==2)
-                               *begin++ = '"';
-                       *begin++ = '$';
-               }
                if(cmd_completion && mode=='\\')
                        out = strcopy(begin,path_basename(cp= *com++));
                else if(mode=='*')
-                       out = strcopy(begin,sh_fmtq(*com++));
+               {
+                       if(ep->e_nlist && dir && var)
+                       {
+                               if(*cp==var)
+                                       cp++;
+                               else
+                                       *begin++ = var;
+                               out = strcopy(begin,cp);
+                               var = 0;
+                       }
+                       else
+                               out = strcopy(begin,sh_fmtq(*com));
+                       com++;
+               }
                else
                        out = strcopy(begin,*com++);
                if(mode=='\\')
                {
-                       char *saveout = ".";
-                       int c, nocase;
-                       if(dir)
-                       {
-                               c = *dir;
-                               *dir = 0;
-                               saveout = begin;
-                       }
-                       if(saveout=astconf("PATH_ATTRIBUTES",saveout,(char*)0))
-                               nocase = (strchr(saveout,'c')!=0);
-                       if(dir)
-                               *dir = c;
-                       if(!var && addstar==0)
+                       if(var!='$' && addstar==0)
                                *out++ = '/';
                        saveout= ++out;
                        while (*com && *begin)
@@ -371,13 +384,18 @@
                                /* add quotes if necessary */
                                if((cp=sh_fmtq(begin))!=begin)
                                        out = strcopy(begin,cp);
-                               if(var==2)
-                                       *out++='"';
-                               *out++ = ' ';
-                               *out = 0;
+                               if(var=='$' && begin[-1]=='{')
+                                       *out = '}';
+                               else
+                                       *out = ' ';
+                               *++out = 0;
                        }
                        else if(out[-1]=='/' && (cp=sh_fmtq(begin))!=begin)
+                       {
                                out = strcopy(begin,cp);
+                               if(out[-1] =='"' || out[-1]=='\'')
+                                         *--out = 0;;
+                       }
                        if(*begin==0)
                                ed_ringbell();
                }
@@ -385,23 +403,23 @@
                {
                        while (*com)
                        {
-                               if(var==2)
-                                       *out++  = '"';
                                *out++  = ' ';
-                               if(var)
-                               {
-                                       if(var==2)
-                                               *out++  = '"';
-                                       *out++  = '$';
-                               }
                                out = strcopy(out,sh_fmtq(*com++));
                        }
-                       if(var==2)
-                               *out++  = '"';
                }
                if(ep->e_nlist)
                {
-                       *out++ = ' ';
+                       cp = com[-1];
+                       if(cp[strlen(cp)-1]!='/')
+                       {
+                               if(var=='$' && begin[-1]=='{')
+                                       *out = '}';
+                               else
+                                       *out = ' ';
+                               out++;
+                       }
+                       else if(out[-1] =='"' || out[-1]=='\'')
+                               out--;
                        *out = 0;
                }
                *cur = (out-outbuff);
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/edit/edit.c 
ksh93_2006_06_30/src/cmd/ksh93/edit/edit.c
--- ksh93_2006_06_16/src/cmd/ksh93/edit/edit.c  2006-06-06 20:33:06.000000000 
+0200
+++ ksh93_2006_06_30/src/cmd/ksh93/edit/edit.c  2006-06-29 04:52:03.000000000 
+0200
@@ -594,6 +594,7 @@
                signal(SIGWINCH,sh_fault);
                sh.sigflag[SIGWINCH] |= SH_SIGFAULT;
        }
+       sh_fault(SIGWINCH);
 #endif
 #if KSHELL
        ep->e_stkptr = stakptr(0);
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/edit/emacs.c 
ksh93_2006_06_30/src/cmd/ksh93/edit/emacs.c
--- ksh93_2006_06_16/src/cmd/ksh93/edit/emacs.c 2006-06-06 00:02:44.000000000 
+0200
+++ ksh93_2006_06_30/src/cmd/ksh93/edit/emacs.c 2006-06-23 22:47:45.000000000 
+0200
@@ -329,7 +329,7 @@
                        continue;
 #endif /* u370 */
                case '\t':
-                       if(cur>0 && cur>=eol && out[cur-1]!='\t' && 
out[cur-1]!=' ' && ep->ed->sh->nextprompt)
+                       if(cur>0 && cur>=eol  && ep->ed->sh->nextprompt)
                        {
                                if(ep->ed->e_tabcount==0)
                                {
@@ -950,7 +950,11 @@
                                }
                        }
                        else
+                       {
+                               if(i=='\\' && cur>ep->mark && (out[cur-1]=='/' 
|| out[cur-1]==' '))
+                                       ep->ed->e_tabcount=0;
                                draw(ep,UPDATE);
+                       }
                        return(-1);
 
                /* search back for character */
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/edit/vi.c 
ksh93_2006_06_30/src/cmd/ksh93/edit/vi.c
--- ksh93_2006_06_16/src/cmd/ksh93/edit/vi.c    2006-06-02 00:00:14.000000000 
+0200
+++ ksh93_2006_06_30/src/cmd/ksh93/edit/vi.c    2006-06-23 22:56:01.000000000 
+0200
@@ -1474,7 +1474,7 @@
                        return;
 
                case '\t':              /** command completion **/
-                       if(mode!=SEARCH && last_virt>=0 && cur_virt>=last_virt 
&& !isblank(cur_virt) && vp->ed->sh->nextprompt)
+                       if(mode!=SEARCH && last_virt>=0 && cur_virt>=last_virt 
&& (vp->ed->e_tabcount|| !isblank(cur_virt)) && vp->ed->sh->nextprompt)
                        {
                                if(vp->ed->e_tabcount==0)
                                {
@@ -2298,6 +2298,7 @@
                save_v(vp);
                i = last_virt;
                ++last_virt;
+               mode = cur_virt-1;
                virtual[last_virt] = 0;
                if(ed_expand(vp->ed,(char*)virtual, &cur_virt, &last_virt, c, 
vp->repeat_set?vp->repeat:-1)<0)
                {
@@ -2323,7 +2324,7 @@
                        --cur_virt;
                        --last_virt;
                        vp->ocur_virt = MAXCHAR;
-                       if(c=='=')
+                       if(c=='=' || (mode>cur_virt && (virtual[cur_virt]==' ' 
|| virtual[cur_virt]=='/')))
                                vp->ed->e_tabcount = 0;
                        return(APPEND);
                }
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/features/math 
ksh93_2006_06_30/src/cmd/ksh93/features/math
--- ksh93_2006_06_16/src/cmd/ksh93/features/math        2003-02-23 
19:18:58.000000000 +0100
+++ ksh93_2006_06_30/src/cmd/ksh93/features/math        2006-06-26 
20:25:43.000000000 +0200
@@ -1,4 +1,4 @@
-lib    absl,acosl,acoshl,asinl,asinhl,atanl,atan2l,expl,cosl,coshl     math.h
-lib    fabsl,powl,hypotl,fmodl,logl,sinl,sqrtl,tanl,tanhl,strtold      math.h
-npt    absl,acosl,acoshl,asinl,asinhl,atanl,atan2l,expl,cosl,coshl     math.h
-npt    fabsl,powl,hypotl,fmodl,logl,sinl,sqrtl,tanl,tanhl,strtold      math.h
+lib,npt        absl,acosl,acoshl,asinl,asinhl,atanl,atan2l,expl,cosl,coshl     
math.h
+lib,npt        fabsl,powl,hypotl,fmodl,logl,sinl,sinhl,sqrtl,tanl,tanhl        
math.h
+lib,npt        strtold,isinf,isinfl,isnan,isnanl,isnormal,isnormall            
math.h
+lib,npt        finite,finitel,isfinite                                         
math.h
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/include/defs.h 
ksh93_2006_06_30/src/cmd/ksh93/include/defs.h
--- ksh93_2006_06_16/src/cmd/ksh93/include/defs.h       2006-06-13 
21:02:16.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/include/defs.h       2006-06-21 
23:44:07.000000000 +0200
@@ -184,6 +184,7 @@
        History_t       *hist_ptr; \
        char            universe; \
        void            *jmpbuffer; \
+       void            *mktype; \
        Sfio_t          *strbuf; \
        char            ifstable[256]; \
        Shopt_t         offoptions;
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/include/name.h 
ksh93_2006_06_30/src/cmd/ksh93/include/name.h
--- ksh93_2006_06_16/src/cmd/ksh93/include/name.h       2006-06-12 
17:54:10.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/include/name.h       2006-06-21 
23:42:17.000000000 +0200
@@ -63,6 +63,7 @@
 #define ARRAY_INCR     32      /* number of elements to grow when array 
                                   bound exceeded.  Must be a power of 2 */
 #define ARRAY_FILL     (8L<<ARRAY_BITS)        /* used with nv_putsub() */
+#define ARRAY_NOCLONE  (16L<<ARRAY_BITS)       /* do not clone array disc */
 
 /* These flags are used as options to array_get() */
 #define ARRAY_ASSIGN   0
@@ -84,7 +85,7 @@
 
 /* The following attributes are for internal use */
 #define NV_NOCHANGE    (NV_EXPORT|NV_IMPORT|NV_RDONLY|NV_TAGGED|NV_NOFREE)
-#define NV_ATTRIBUTES  
(~(NV_NOSCOPE|NV_ARRAY|NV_IDENT|NV_ASSIGN|NV_REF|NV_VARNAME))
+#define NV_ATTRIBUTES  
(~(NV_NOSCOPE|NV_ARRAY|NV_NOARRAY|NV_IDENT|NV_ASSIGN|NV_REF|NV_VARNAME))
 #define NV_PARAM       NV_NODISC       /* expansion use positional params */
 
 /* This following are for use with nodes which are not name-values */
@@ -155,9 +156,12 @@
 extern void            nv_attribute(Namval_t*, Sfio_t*, char*, int);
 extern Namval_t                *nv_bfsearch(const char*, Dt_t*, Namval_t**, 
char**);
 extern Namval_t                *nv_mkclone(Namval_t*);
+extern Namval_t                *nv_mktype(Namval_t**, int);
+extern void            nv_addnode(Namval_t*, int);
 extern Namval_t                *nv_parent(Namval_t*);
 extern char            *nv_getbuf(size_t);
 extern Namval_t                *nv_mount(Namval_t*, const char *name, Dt_t*);
+extern Namval_t                *nv_arraychild(Namval_t*, Namval_t*, int);
 extern int             nv_compare(Dt_t*, Void_t*, Void_t*, Dtdisc_t*);
 
 extern const Namdisc_t RESTRICTED_disc;
@@ -174,6 +178,7 @@
 extern const char      e_varname[];
 extern const char      e_funname[];
 extern const char      e_noalias[];
+extern const char      e_noarray[];
 extern const char      e_aliname[];
 extern const char      e_badexport[];
 extern const char      e_badref[];
@@ -182,4 +187,5 @@
 extern const char      e_envmarker[];
 extern const char      e_badlocale[];
 extern const char      e_loop[];
+extern const char      e_redef[];
 #endif /* _NV_PRIVATE */
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/include/nval.h 
ksh93_2006_06_30/src/cmd/ksh93/include/nval.h
--- ksh93_2006_06_16/src/cmd/ksh93/include/nval.h       2006-04-19 
22:28:02.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/include/nval.h       2006-06-21 
22:36:13.000000000 +0200
@@ -90,7 +90,7 @@
        Namfun_t        hdr;
        long            nelem;                          /* number of elements */
        void    *(*fun)(Namval_t*,const char*,int);     /* associative arrays */
-       Namval_t        *parent;                /* for multi-dimenstional */
+       Namval_t        *parent;                /* for multi-dimensional */
 };
 
 /* Passed as third argument to a builtin when  NV_BLTINOPT is set on node */
@@ -130,7 +130,7 @@
 #endif /* _NV_PRIVATE */
 };
 
-#define NV_CLASS       ".sh.type."
+#define NV_CLASS       ".sh.type"
 #define NV_MINSZ       (sizeof(struct Namval)-sizeof(Dtlink_t)-sizeof(char*))
 #define nv_namptr(p,n) ((Namval_t*)((char*)(p)+(n)*NV_MINSZ-sizeof(Dtlink_t)))
 
@@ -173,7 +173,7 @@
                                        /* add node if not found */
 #define NV_ASSIGN      NV_NOFREE       /* assignment is possible */
 #define NV_NOASSIGN    0               /* backward compatibility */
-#define NV_NOARRAY     NV_ARRAY        /* array name not possible */
+#define NV_NOARRAY     0x200000        /* array name not possible */
 #define NV_NOREF       NV_REF          /* don't follow reference */
 #define NV_IDENT       0x80            /* name must be identifier */
 #define NV_VARNAME     0x20000         /* name must be ?(.)id*(.id) */
@@ -236,7 +236,7 @@
 extern Namval_t        *nv_opensub(Namval_t*);
 
 /* name-value pair function prototypes */
-extern int             nv_adddisc(Namval_t*, const char**names, Namval_t**);
+extern int             nv_adddisc(Namval_t*, const char**, Namval_t**);
 extern int             nv_clone(Namval_t*, Namval_t*, int);
 extern void            nv_close(Namval_t*);
 extern void            *nv_context(Namval_t*);
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/include/shell.h 
ksh93_2006_06_30/src/cmd/ksh93/include/shell.h
--- ksh93_2006_06_16/src/cmd/ksh93/include/shell.h      2005-08-31 
20:58:14.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/include/shell.h      2006-06-21 
22:40:55.000000000 +0200
@@ -35,15 +35,7 @@
 #   include    <nval.h>
 #endif /* _SH_PRIVATE */
 
-#define SH_VERSION     20030620
-
-/*
- *  The following will disappear in a future release so change all sh_fun
- *  calls to use three arguments and sh_waitnotify specify a function
- *  that will be called with three arguments.  The third argument to
- *  the waitnotify function will 0 for input, 1 for output.
- */
-#define sh_waitnotify  _sh_waitnotify
+#define SH_VERSION     20060510
 
 #undef NOT_USED
 #define NOT_USED(x)    (&x,1)
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/include/shlex.h 
ksh93_2006_06_30/src/cmd/ksh93/include/shlex.h
--- ksh93_2006_06_16/src/cmd/ksh93/include/shlex.h      2005-11-17 
22:56:17.000000000 +0100
+++ ksh93_2006_06_30/src/cmd/ksh93/include/shlex.h      2006-06-21 
22:42:18.000000000 +0200
@@ -118,6 +118,8 @@
 #define        SH_FUNDEF       040
 #define SH_ARRAY       0100
 
+#define SH_COMPASSIGN  010     /* allow compound assignments only */
+
 typedef struct  _shlex_
 {
        struct shlex_t          _shlex;
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/include/streval.h 
ksh93_2006_06_30/src/cmd/ksh93/include/streval.h
--- ksh93_2006_06_16/src/cmd/ksh93/include/streval.h    2006-06-07 
16:02:27.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/include/streval.h    2006-06-19 
23:46:05.000000000 +0200
@@ -82,7 +82,7 @@
 
 struct mathtab
 {
-       char            fname[8];
+       char            fname[10];
        Sfdouble_t      (*fnptr)(Sfdouble_t,...);
 };
 
@@ -138,25 +138,26 @@
 #define A_TILDE                31
 #define A_REG          32
 #define A_DIG          33
-#define A_INCR          34
-#define A_DECR          35
-#define A_PUSHV         36
-#define A_PUSHL         37
-#define A_PUSHN         38
-#define A_PUSHF         39
-#define A_STORE         40
-#define A_POP           41
-#define A_SWAP          42
+#define A_INCR         34
+#define A_DECR         35
+#define A_PUSHV        36
+#define A_PUSHL        37
+#define A_PUSHN        38
+#define A_PUSHF        39
+#define A_STORE        40
+#define A_POP          41
+#define A_SWAP         42
 #define A_UMINUS       43
-#define A_JMPZ          44
-#define A_JMPNZ         45
-#define A_JMP           46
-#define A_CALL1         47
-#define A_CALL2         48
-#define A_CALL3         49
-#define A_DOT          50
-#define A_LIT          51
-#define A_NOTNOT        52
+#define A_JMPZ         44
+#define A_JMPNZ                45
+#define A_JMP          46
+#define A_CALL0                47
+#define A_CALL1                48
+#define A_CALL2                49
+#define A_CALL3                50
+#define A_DOT          51
+#define A_LIT          52
+#define A_NOTNOT        53
 
 
 /* define error messages */
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/Makefile 
ksh93_2006_06_30/src/cmd/ksh93/Makefile
--- ksh93_2006_06_16/src/cmd/ksh93/Makefile     2006-05-18 16:19:41.000000000 
+0200
+++ ksh93_2006_06_30/src/cmd/ksh93/Makefile     2006-06-28 05:26:17.000000000 
+0200
@@ -203,7 +203,9 @@
 
 else
 
-test : $(BINDIR)/$(SH) $(SH) shtests
+test : test.ksh - test.shcomp
+
+test.ksh : $(BINDIR)/$(SH) $(SH) shtests
        $(SILENT) $(CMP) $(CMPFLAGS) $(*:O=1) $(*:O=2) 2>/dev/null ||
        echo "make install to run the tests on the latest $(SH)" >&2
        cd $(*:O=3:P=L!:D)
@@ -215,4 +217,18 @@
        cd $(*:O=4:P=L!:D)
        SHELL=$(*:O=2:P=A) $(*:O=2:P=A) $(*:O=4:B) $(*:O=1:P=A)
 
+test.shcomp : $(BINDIR)/$(SH) $(SH) shtests shcomp
+       $(SILENT) $(CMP) $(CMPFLAGS) $(*:O=1) $(*:O=2) 2>/dev/null ||
+       echo "make install to run the tests on the latest $(SH)" >&2
+       cd $(*:O=3:P=L!:D)
+       tmp=/tmp/ksh-$(tmp)
+       mkdir $tmp
+       for i in *.sh
+       do      tst=$tmp/shcomp-${i%.sh}.ksh
+               shcomp $i > $tst
+               SHELL=$(*:O=1:P=A) $(*:O=1:P=A) $(*:O=3:B) $tst
+               rm -f $tst
+       done
+       rm -rf $tmp
+
 end
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/Mamfile 
ksh93_2006_06_30/src/cmd/ksh93/Mamfile
--- ksh93_2006_06_16/src/cmd/ksh93/Mamfile      2006-06-16 11:07:23.000000000 
+0200
+++ ksh93_2006_06_30/src/cmd/ksh93/Mamfile      2006-06-30 15:38:24.000000000 
+0200
@@ -1,4 +1,4 @@
-info mam static 00000 1994-07-17 make (AT&T Research) 5.1 2006-05-09
+info mam static 00000 1994-07-17 make (AT&T Research) 5.1 2006-05-21
 setv INSTALLROOT ../../..
 setv PACKAGE_ast_INCLUDE ${INSTALLROOT}/include/ast
 setv PACKAGE_ast_LIB ${INSTALLROOT}/lib
@@ -747,6 +747,11 @@
 prev include/io.h implicit
 prev include/path.h implicit
 prev include/lexstates.h implicit
+make ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit
+prev ${PACKAGE_ast_INCLUDE}/stdio.h implicit
+prev ${PACKAGE_ast_INCLUDE}/stdio.h implicit
+prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit
+done ${PACKAGE_ast_INCLUDE}/ast_wchar.h
 prev include/defs.h implicit
 done edit/completion.c
 meta completion.o %.c>%.o edit/completion.c completion
@@ -861,11 +866,7 @@
 make init.o
 make sh/init.c
 make ${PACKAGE_ast_INCLUDE}/wchar.h implicit
-make ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit
-prev ${PACKAGE_ast_INCLUDE}/stdio.h implicit
-prev ${PACKAGE_ast_INCLUDE}/stdio.h implicit
-prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit
-done ${PACKAGE_ast_INCLUDE}/ast_wchar.h dontcare
+prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit
 done ${PACKAGE_ast_INCLUDE}/wchar.h dontcare
 make include/version.h implicit
 done include/version.h
@@ -950,7 +951,7 @@
 done sh/lex.c
 meta lex.o %.c>%.o sh/lex.c lex
 prev sh/lex.c
-exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} 
-DSHOPT_APPEND -DSHOPT_OO -DSHOPT_MULTIBYTE -DSHOPT_KIA -D_BLD_shell 
-D_PACKAGE_ast -DSHOPT_PFSH -DKSHELL -DSHOPT_DYNAMIC -DSHOPT_HISTEXPAND 
-DSHOPT_ESH -c sh/lex.c
+exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} 
-DSHOPT_OO -DSHOPT_MULTIBYTE -DSHOPT_KIA -D_BLD_shell -D_PACKAGE_ast 
-DSHOPT_PFSH -DKSHELL -DSHOPT_DYNAMIC -DSHOPT_HISTEXPAND -DSHOPT_ESH -c sh/lex.c
 done lex.o generated
 make macro.o
 make sh/macro.c
@@ -1010,7 +1011,7 @@
 done sh/parse.c
 meta parse.o %.c>%.o sh/parse.c parse
 prev sh/parse.c
-exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} 
-DSHOPT_NAMESPACE -DSHOPT_APPEND -DSHOPT_COMPOUND_ARRAY -DSHOPT_SUID_EXEC 
-DSHOPT_BRACEPAT -D_BLD_shell -D_PACKAGE_ast -DSHOPT_MULTIBYTE -DSHOPT_PFSH 
-DSHOPT_KIA -DSHOPT_ESH -DSHOPT_DYNAMIC -DSHOPT_OO -DSHOPT_HISTEXPAND -DKSHELL 
-c sh/parse.c
+exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} 
-DSHOPT_NAMESPACE -DSHOPT_COMPOUND_ARRAY -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT 
-D_BLD_shell -D_PACKAGE_ast -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DSHOPT_KIA 
-DSHOPT_ESH -DSHOPT_DYNAMIC -DSHOPT_OO -DSHOPT_HISTEXPAND -DKSHELL -c sh/parse.c
 done parse.o generated
 make path.o
 make sh/path.c
@@ -1534,6 +1535,7 @@
 done ${INSTALLROOT}/fun/pushd generated
 done install virtual
 make test
+make test.ksh
 prev ${INSTALLROOT}/bin/ksh
 prev ksh
 make tests/shtests
@@ -1542,4 +1544,23 @@
 exec - echo "make install to run the tests on the latest ksh" >&2
 exec - cd ${PACKAGEROOT}/src/cmd/ksh93/tests
 exec - SHELL=${INSTALLROOT}/bin/ksh ${INSTALLROOT}/bin/ksh shtests
+done test.ksh virtual
+make test.shcomp
+prev ${INSTALLROOT}/bin/ksh
+prev ksh
+prev tests/shtests
+prev shcomp
+exec - silent cmp 2>/dev/null -s ${INSTALLROOT}/bin/ksh ksh 2>/dev/null ||
+exec - echo "make install to run the tests on the latest ksh" >&2
+exec - cd ${PACKAGEROOT}/src/cmd/ksh93/tests
+exec - tmp=/tmp/ksh-${COTEMP}
+exec - mkdir $tmp
+exec - for i in *.sh
+exec - do      tst=$tmp/shcomp-${i%.sh}.ksh
+exec -         shcomp $i > $tst
+exec -         SHELL=${INSTALLROOT}/bin/ksh ${INSTALLROOT}/bin/ksh shtests $tst
+exec -         rm -f $tst
+exec - done
+exec - rm -rf $tmp
+done test.shcomp virtual
 done test dontcare virtual
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/RELEASE 
ksh93_2006_06_30/src/cmd/ksh93/RELEASE
--- ksh93_2006_06_16/src/cmd/ksh93/RELEASE      2006-06-14 05:06:24.000000000 
+0200
+++ ksh93_2006_06_30/src/cmd/ksh93/RELEASE      2006-06-23 23:33:26.000000000 
+0200
@@ -1,4 +1,12 @@
-06-06-13  --- Release ksh93r+  ---
+06-06-23  --- Release ksh93r+  ---
+06-06-23  A number of bug fixes for  command, file, and variable completion
+         have been mode.
+06-06-20  Floating point division by zero now yields the constant Inf or -Inf
+         and floating functions with invalid arguments yield NaN. 
+06-06-20  The floating point constants Inf and NaN can be used in arithmetic
+         expressions.
+06-06-20  The functions isinf(), isnan(), tanhl() have been added for
+         arithmetic expressions.
 06-06-13  Internal change to use ordering for variables instead of hashing
          to speed up prefix matching.
 06-06-13  A window between fork/exec in which a signal could get lost
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/sh/arith.c 
ksh93_2006_06_30/src/cmd/ksh93/sh/arith.c
--- ksh93_2006_06_16/src/cmd/ksh93/sh/arith.c   2006-05-22 21:58:44.000000000 
+0200
+++ ksh93_2006_06_30/src/cmd/ksh93/sh/arith.c   2006-06-26 21:16:03.000000000 
+0200
@@ -32,6 +32,21 @@
 #include       "variables.h"
 #include       "FEATURE/locale"
 
+static Sfdouble_t      Zero, NaN, Inf;
+static Namval_t Infnod =
+{
+       { 0 },
+       "Inf",
+       NV_NOFREE|NV_INTEGER|NV_DOUBLE|NV_LONG,NV_RDONLY
+};
+
+static Namval_t NaNnod =
+{
+       { 0 },
+       "NaN",
+       NV_NOFREE|NV_INTEGER|NV_DOUBLE|NV_LONG,NV_RDONLY
+};
+
 static Namval_t *scope(register Namval_t *np,register struct lval *lvalue,int 
assign)
 {
        register Namarr_t *ap;
@@ -148,7 +163,37 @@
                                int offset = staktell();
                                char *saveptr = stakfreeze(0);
                                Dt_t  *root = 
(lvalue->emode&ARITH_COMP)?sh.var_base:sh.var_tree;
-                               np = nv_open(*ptr,root,NV_NOASSIGN|NV_VARNAME);
+                               *str = c;
+                               while(c=='[' || c=='.')
+                               {
+                                       if(c=='[')
+                                       {
+                                               str = 
nv_endsubscript(np,cp=str,0);
+                                               if((c= *str)!='[' &&  c!='.')
+                                               {
+                                                       str = cp;
+                                                       c = '[';
+                                                       break;
+                                               }
+                                       }
+                                       else
+                                               while(c= *++str, isaname(c));
+                               }
+                               *str = 0;
+                               if(strcmp(*ptr,"Inf")==0)
+                               {
+                                       Inf = 1.0/Zero;
+                                       Infnod.nvalue.ldp = &Inf;
+                                       np = &Infnod;
+                               }
+                               else if(strcmp(*ptr,"NaN")==0)
+                               {
+                                       NaN = 0.0/Zero;
+                                       NaNnod.nvalue.ldp = &NaN;
+                                       np = &NaNnod;
+                               }
+                               else
+                                       np = 
nv_open(*ptr,root,NV_NOASSIGN|NV_VARNAME);
                                if(saveptr != stakptr(0))
                                        stakset(saveptr,offset);
                                else
@@ -163,12 +208,18 @@
                                if(c=='[')
                                {
                                        lvalue->flag = (str-lvalue->expr);
-                                       str = nv_endsubscript(np,str,0);
+                                       do
+                                               str = nv_endsubscript(np,str,0);
+                                       while((c= *str)=='[');
                                }
                                break;
                        }
                        if(c=='[')
-                               str = 
nv_endsubscript(np,str,NV_ADD|NV_SUBQUOTE);
+                       {
+                               do
+                                       str = 
nv_endsubscript(np,str,NV_ADD|NV_SUBQUOTE);
+                               while((c=*str)=='[');
+                       }
                        else if(nv_isarray(np))
                                nv_putsub(np,NIL(char*),ARRAY_UNDEF);
                        
if(nv_isattr(np,NV_INTEGER|NV_DOUBLE)==(NV_INTEGER|NV_DOUBLE))
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/sh/expand.c 
ksh93_2006_06_30/src/cmd/ksh93/sh/expand.c
--- ksh93_2006_06_16/src/cmd/ksh93/sh/expand.c  2005-03-29 09:58:21.000000000 
+0200
+++ ksh93_2006_06_30/src/cmd/ksh93/sh/expand.c  2006-06-27 20:37:38.000000000 
+0200
@@ -124,6 +124,7 @@
 #   endif
 #endif /* KSHELL */
                flags |= GLOB_COMPLETE;
+               flags &= ~GLOB_NOCHECK;
        }
 #if SHOPT_BASH
        if(off = staktell())
@@ -200,7 +201,6 @@
                if(!ap->argnxt.ap)
                        ap->argchn.ap = *arghead;
        }
-       *arghead = (struct argnod*)gp->gl_list;
        if(gp->gl_list)
                *arghead = (struct argnod*)gp->gl_list;
        return(gp->gl_pathc+extra);
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/sh/fault.c 
ksh93_2006_06_30/src/cmd/ksh93/sh/fault.c
--- ksh93_2006_06_16/src/cmd/ksh93/sh/fault.c   2006-06-13 21:07:06.000000000 
+0200
+++ ksh93_2006_06_30/src/cmd/ksh93/sh/fault.c   2006-06-28 04:07:54.000000000 
+0200
@@ -67,12 +67,6 @@
        if(!(sig&SH_TRAP))
                signal(sig, sh_fault);
        sig &= ~SH_TRAP;
-       if(sh.savesig)
-       {
-               /* critical region, save and process later */
-               sh.savesig = sig;
-               return;
-       }
 #ifdef SIGWINCH
        if(sig==SIGWINCH)
        {
@@ -84,6 +78,12 @@
                        nv_putval(LINES, (char*)&rows, NV_INTEGER);
        }
 #endif  /* SIGWINCH */
+       if(sh.savesig)
+       {
+               /* critical region, save and process later */
+               sh.savesig = sig;
+               return;
+       }
 
        /* handle ignored signals */
        if((trap=sh.st.trapcom[sig]) && *trap==0)
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/sh/lex.c 
ksh93_2006_06_30/src/cmd/ksh93/sh/lex.c
--- ksh93_2006_06_16/src/cmd/ksh93/sh/lex.c     2006-05-17 16:23:01.000000000 
+0200
+++ ksh93_2006_06_30/src/cmd/ksh93/sh/lex.c     2006-06-21 23:00:11.000000000 
+0200
@@ -1074,6 +1074,8 @@
                                {
                                        if((c=fcget())=='~')
                                                wordflags |= ARG_MAC;
+                                       else if(c!=LPAREN && 
assignment==SH_COMPASSIGN)
+                                               assignment = 0;
                                        fcseek(-1);
                                }
                                break;
@@ -1144,11 +1146,9 @@
                                }
                                if(n>0)
                                        fcseek(-1);
-#if SHOPT_APPEND
                                if(n=='=' && c=='+' && mode==ST_NAME)
                                        continue;
                                break;
-#endif /* SHOPT_APPEND */
                }
                lex.comp_assign = 0;
                if(mode==ST_NAME)
@@ -1383,8 +1383,8 @@
                        {
                                setupalias(lp,state,np);
                                nv_onattr(np,NV_NOEXPAND);
-                               shlex.assignok++;
                                lex.reservok = 1;
+                               shlex.assignok |= lex.reservok;
                                return(sh_lex());
                        }
                }
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/sh/parse.c 
ksh93_2006_06_30/src/cmd/ksh93/sh/parse.c
--- ksh93_2006_06_16/src/cmd/ksh93/sh/parse.c   2006-05-08 23:02:47.000000000 
+0200
+++ ksh93_2006_06_30/src/cmd/ksh93/sh/parse.c   2006-06-22 00:24:32.000000000 
+0200
@@ -751,7 +751,7 @@
 static struct argnod *assign(register struct argnod *ap)
 {
        register int n;
-       register Shnode_t *t ,**tp;
+       register Shnode_t *t, **tp;
        register struct comnod *ac;
        int array=0;
        Namval_t *np;
@@ -762,13 +762,11 @@
        if(ap->argval[n]!='=' || ap->argval[n-1]==']')
 #endif
                sh_syntax();
-#if SHOPT_APPEND
        if(ap->argval[n-1]=='+')
        {
                ap->argval[n--]=0;
                array = ARG_APPEND;
        }
-#endif /* SHOPT_APPEND */
        /* shift right */
        while(n > 0)
        {
@@ -785,34 +783,65 @@
        ap->argflag |= array;
        shlex.assignok = SH_ASSIGN;
        array=0;
-       if(skipnl())
+       if((n=skipnl())==RPAREN || n==LPAREN)
        {
-               if(shlex.token!=RPAREN)
-                       sh_syntax();
                ac = (struct comnod*)getnode(comnod);
                memset((void*)ac,0,sizeof(*ac));
                ac->comline = sh_getlineno();
+               while(n==LPAREN)
+               {
+                       int index= 1;
+                       struct argnod *ap, **settail= &(ac->comset);
+                       ap = (struct argnod*)stakseek(ARGVAL);
+                       ap->argflag= ARG_ASSIGN;
+                       sfprintf(stkstd,"[%d]=",index++);
+                       ap = (struct argnod*)stakfreeze(1);
+                       ap->argnxt.ap = 0;
+                       ap = assign(ap);
+                       *settail = ap;
+                       settail = &(ap->argnxt.ap);
+                       n = skipnl();
+               }
        }
+       else if(n)
+               sh_syntax();
        else if(!(shlex.arg->argflag&ARG_ASSIGN) && 
!((np=nv_search(shlex.arg->argval,sh.fun_tree,0)) && nv_isattr(np,BLT_DCL)))
                array=SH_ARRAY;
        while(1)
        {
-               if(shlex.token==RPAREN)
+               if((n=shlex.token)==RPAREN)
                        break;
-               ac = (struct comnod*)simple(SH_NOIO|SH_ASSIGN|array,NIL(struct 
ionod*));
+               if(n==FUNCTSYM || n==SYMRES)
+                       ac = (struct comnod*)funct();
+               else
+                       ac = (struct 
comnod*)simple(SH_NOIO|SH_ASSIGN|array,NIL(struct ionod*));
                if((n=shlex.token)==RPAREN)
                        break;
                if(n!=NL && n!=';')
                        sh_syntax();
                shlex.assignok = SH_ASSIGN;
-               if(skipnl() || array)
+               if((n=skipnl()) || array)
                {
-                       if(shlex.token==RPAREN)
+                       if(n==RPAREN)
                                break;
-                       sh_syntax();
+                       if(array ||  n!=FUNCTSYM)
+                               sh_syntax();
+               }
+               if((n!=FUNCTSYM) && !(shlex.arg->argflag&ARG_ASSIGN) && 
!((np=nv_search(shlex.arg->argval,sh.fun_tree,0)) && nv_isattr(np,BLT_DCL)))
+               {
+                       struct argnod *arg = shlex.arg;
+                       if(n!=0)
+                               sh_syntax();
+                       /* check for sys5 style function */
+                       if(sh_lex()!=LPAREN || sh_lex()!=RPAREN)
+                       {
+                               shlex.arg = arg;
+                               shlex.token = 0;
+                               sh_syntax();
+                       }
+                       shlex.arg = arg;
+                       shlex.token = SYMRES;
                }
-               if(!(shlex.arg->argflag&ARG_ASSIGN) && 
!((np=nv_search(shlex.arg->argval,sh.fun_tree,0)) && nv_isattr(np,BLT_DCL)))
-                       sh_syntax();
                t = makelist(TLST,(Shnode_t*)ac,t);
                *tp = t;
                tp = &t->lst.lstrit;
@@ -1071,11 +1100,8 @@
        int     associative=0;
        if((argp=shlex.arg) && (argp->argflag&ARG_ASSIGN) && 
argp->argval[0]=='[')
        {
-               if(fcpeek(0)!=LPAREN)
-               {
-                       flag |= SH_ARRAY;
-                       associative = 1;
-               }
+               flag |= SH_ARRAY;
+               associative = 1;
        }
        t = (struct comnod*)getnode(comnod);
        t->comio=io; /*initial io chain*/
@@ -1143,7 +1169,8 @@
                        }
                        *argtail = argp;
                        argtail = &(argp->argnxt.ap);
-                       shlex.assignok = key_on;
+                       if(!(shlex.assignok=key_on)  && !(flag&SH_NOIO))
+                               shlex.assignok = SH_COMPASSIGN;
                        shlex.aliasok = 0;
                }
        retry:
@@ -1169,9 +1196,11 @@
                        if(argp->argflag&ARG_ASSIGN)
                        {
                                argp = assign(argp);
+                               if(associative)
+                                       shlex.assignok |= SH_ASSIGN;
                                goto retry;
                        }
-                       if(argno==1 && !t->comset)
+                       else if(argno==1 && !t->comset)
                        {
                                /* SVR2 style function */
                                if(sh_lex() == RPAREN)
@@ -1574,7 +1603,6 @@
                                ere_match();
                                num = TEST_PEQ;
                        }
-
                }
                else if(token=='<')
                        num = TEST_SLT;
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/sh/streval.c 
ksh93_2006_06_30/src/cmd/ksh93/sh/streval.c
--- ksh93_2006_06_16/src/cmd/ksh93/sh/streval.c 2006-01-19 23:59:00.000000000 
+0100
+++ ksh93_2006_06_30/src/cmd/ksh93/sh/streval.c 2006-06-19 23:41:17.000000000 
+0200
@@ -78,6 +78,7 @@
        Sfdouble_t      (*convert)(const char**,struct lval*,int,Sfdouble_t);
 };
 
+typedef int       (*Math_0_f)(Sfdouble_t);
 typedef Sfdouble_t (*Fun_t)(Sfdouble_t,...);
 typedef Sfdouble_t (*Math_1_f)(Sfdouble_t);
 typedef Sfdouble_t (*Math_2_f)(Sfdouble_t,Sfdouble_t);
@@ -303,10 +304,7 @@
                    case A_DIV:
                        if(type==1 || tp[-1]==1)
                        {
-                               if(!num)
-                                       
arith_error(e_divzero,ep->expr,ep->emode);
-                               else
-                                       num = sp[-1]/num;
+                               num = sp[-1]/num;
                                type = 1;
                        }
                        else if((Sfulong_t)(num)==0)
@@ -370,6 +368,12 @@
                        num = (sp[-1]<num);
                        type=0;
                        break;
+                   case A_CALL0:
+                       sp--,tp--;
+                       fun = *((Fun_t*)(ep->code+(int)(*sp)));
+                       type = 0;
+                       num = (*((Math_0_f)fun))(num);
+                       break;
                    case A_CALL1:
                        sp--,tp--;
                        fun = *((Fun_t*)(ep->code+(int)(*sp)));
@@ -619,11 +623,13 @@
                        vp->paren--;
                        if(fun)
                        {
+                               int  x= (nargs>7);
+                               nargs &= 7;
                                if(vp->infun != nargs)
                                        ERROR(vp,e_argcount);
                                if(vp->staksize+=nargs>=vp->stakmaxsize)
                                        vp->stakmaxsize = vp->staksize+nargs;
-                               stakputc(A_CALL1+nargs-1);
+                               stakputc(A_CALL0+nargs -x);
                                vp->staksize -= nargs;
                        }
                        vp->infun = infun;
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/sh/tdump.c 
ksh93_2006_06_30/src/cmd/ksh93/sh/tdump.c
--- ksh93_2006_06_16/src/cmd/ksh93/sh/tdump.c   2005-04-08 21:15:59.000000000 
+0200
+++ ksh93_2006_06_30/src/cmd/ksh93/sh/tdump.c   2006-06-28 02:47:27.000000000 
+0200
@@ -204,9 +204,9 @@
                }
                else
                        sfputu(outfile,0);
-               iop = iop->ionxt;
                if(iop->iovname)
                        p_string(iop->iovname);
+               iop = iop->ionxt;
        }
        return(sfputl(outfile,-1));
 }
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/sh/xec.c 
ksh93_2006_06_30/src/cmd/ksh93/sh/xec.c
--- ksh93_2006_06_16/src/cmd/ksh93/sh/xec.c     2006-06-13 21:11:35.000000000 
+0200
+++ ksh93_2006_06_30/src/cmd/ksh93/sh/xec.c     2006-06-21 21:05:24.000000000 
+0200
@@ -589,7 +589,7 @@
                    {
                        register struct argnod  *argp;
                        char            *trap;
-                       Namval_t        *np, *nq;
+                       Namval_t        *np, *nq, *last_table;
                        struct ionod    *io;
                        int             command=0;
                        error_info.line = t->com.comline-sh.st.firstline;
@@ -680,6 +680,7 @@
                                        argp = NULL;
                                }
                        }
+                       last_table = sh.last_table;
                        sh.last_table = 0;
                        if((io||argn))
                        {
@@ -874,6 +875,7 @@
                                {
                                        int indx,jmpval=0;
                                        struct checkpt buff;
+                                       Namval_t node;
                                        register struct slnod *slp;
                                        if(!np->nvalue.ip)
                                        {
@@ -905,9 +907,18 @@
                                        staklink(slp->slptr);
                                        if(nq)
                                        {
+                                               sh.last_table = last_table;
                                                nv_putval(SH_NAMENOD, 
nv_name(nq), NV_NOFREE);
+                                               
memcpy(&node,L_ARGNOD,sizeof(node));
+                                               L_ARGNOD->nvalue.np = nq;
+                                               L_ARGNOD->nvenv = 0;
+                                               L_ARGNOD->nvfun = 
(Namfun_t*)sh.last_table;
+                                               L_ARGNOD->nvflag = 
NV_REF|NV_NOFREE;
                                                if(nv_arrayptr(nq))
+                                               {
                                                        
nv_putval(SH_SUBSCRNOD,nv_getsub(nq),NV_NOFREE);
+                                                       L_ARGNOD->nvenv = 
(char*)SH_SUBSCRNOD->nvalue.cp;
+                                               }
                                        }
                                        if(io)
                                        {
@@ -930,6 +941,10 @@
                                        }
                                        if(nq)
                                        {
+                                               L_ARGNOD->nvalue.np = 
node.nvalue.np;
+                                               L_ARGNOD->nvenv = node.nvenv;
+                                               L_ARGNOD->nvflag = node.nvflag;
+                                               L_ARGNOD->nvfun = node.nvfun;
                                                nv_unset(SH_NAMENOD);
                                                nv_unset(SH_SUBSCRNOD);
                                        }
@@ -1684,20 +1699,33 @@
                        /* look for discipline functions */
                        error_info.line = t->funct.functline-sh.st.firstline;
                        /* Function names cannot be special builtin */
-                       if((np=nv_search(fname,sh.bltin_tree,0)) && 
nv_isattr(np,BLT_SPC))
-                               errormsg(SH_DICT,ERROR_exit(1),e_badfun,fname);
-                       if(cp)
+                       if(cp || sh.prefix)
                        {
                                int offset = staktell();
-                               stakwrite(fname,cp-fname);
-                               stakputc(0);
-                               npv = 
nv_open(stakptr(offset),sh.var_tree,NV_NOASSIGN|NV_NOARRAY|NV_VARNAME);
+                               if(sh.prefix)
+                               {
+                                       cp = sh.prefix;
+                                       sh.prefix = 0;
+                                       npv = 
nv_open(cp,sh.var_tree,NV_NOASSIGN|NV_NOARRAY|NV_VARNAME);
+                                       sh.prefix = cp;
+                                       cp = fname;
+                               }
+                               else
+                               {
+                                       stakwrite(fname,cp-fname);
+                                       stakputc(0);
+                                       npv = 
nv_open(stakptr(offset),sh.var_tree,NV_NOASSIGN|NV_NOARRAY|NV_VARNAME);
+                               }
                                offset = staktell();
                                stakputs(nv_name(npv));
+                               if(*cp!='.')
+                                       stakputc('.');
                                stakputs(cp);
                                stakputc(0);
                                fname = stakptr(offset);
                        }
+                       else if((np=nv_search(fname,sh.bltin_tree,0)) && 
nv_isattr(np,BLT_SPC))
+                               errormsg(SH_DICT,ERROR_exit(1),e_badfun,fname);
 #if SHOPT_NAMESPACE
                        else if(sh.namespace)
                        {
@@ -2080,6 +2108,8 @@
        /* except for those `lost' by trap   */
        sh_sigreset(2);
        sh.subshell = 0;
+       if((flags&FAMP) && sh.coutpipe>1)
+               sh_close(sh.coutpipe);
        sig = sh.savesig;
        sh.savesig = 0;
        if(sig>0)
@@ -2170,7 +2200,7 @@
                /* eliminate parent scope */
                Dt_t *dt = dtview(sh.var_tree,0);
                dtview(sh.var_tree,dtvnext(prevscope->save_tree));
-               nv_scan(prevscope->save_tree, 
local_exports,(void*)0,NV_EXPORT,NV_EXPORT|NV_NOSCOPE);
+               nv_scan(prevscope->save_tree, local_exports,(void*)0, 
NV_EXPORT, NV_EXPORT|NV_NOSCOPE);
        }
        sh.st.save_tree = sh.var_tree;
        if(!fun)
@@ -2300,6 +2330,7 @@
 {
        register int offset;
        register char *base;
+       Namval_t node;
        int n=0;
        char *av[2];
        Fcin_t save;
@@ -2316,9 +2347,21 @@
                n++;
        if(nq)
        {
+               /*
+                * set ${.sh.name} and ${.sh.subscript}
+                * set _ to reference for ${.sh.name}[$.sh.subscript]
+                */
                nv_putval(SH_NAMENOD, nv_name(nq), NV_NOFREE);
+               memcpy(&node,L_ARGNOD,sizeof(node));
+               L_ARGNOD->nvalue.np = nq;
+               L_ARGNOD->nvenv = 0;
+               L_ARGNOD->nvfun = (Namfun_t*)sh.last_table;
+               L_ARGNOD->nvflag = NV_REF|NV_NOFREE;
                if(nv_arrayptr(nq))
+               {
                        nv_putval(SH_SUBSCRNOD,nv_getsub(nq),NV_NOFREE);
+                       L_ARGNOD->nvenv = (char*)SH_SUBSCRNOD->nvalue.cp;
+               }
        }
        if(is_abuiltin(np))
        {
@@ -2346,6 +2389,10 @@
                sh_funct(np,n,argv,(struct argnod*)0,sh_isstate(SH_ERREXIT));
        if(nq)
        {
+               L_ARGNOD->nvalue.np = node.nvalue.np;
+               L_ARGNOD->nvenv = node.nvenv;
+               L_ARGNOD->nvflag = node.nvflag;
+               L_ARGNOD->nvfun = node.nvfun;
                nv_unset(SH_NAMENOD);
                nv_unset(SH_SUBSCRNOD);
        }
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/sh.1 
ksh93_2006_06_30/src/cmd/ksh93/sh.1
--- ksh93_2006_06_16/src/cmd/ksh93/sh.1 2006-06-08 00:20:25.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/sh.1 2006-06-30 08:45:58.000000000 +0200
@@ -2154,7 +2154,7 @@
 .I n1\^
 by
 .IR n3\^ .
-The the cases where
+The cases where
 .I n3\^
 is not specified behave as if
 .I n3\^
@@ -2364,22 +2364,22 @@
 .RS
 .TP
 .B \ed
-Matches any charcter in the \f3digit\fP class.
+Matches any character in the \f3digit\fP class.
 .TP
 .B \eD
-Matches any charcter not in the \f3digit\fP class.
+Matches any character not in the \f3digit\fP class.
 .TP
 .B \es
-Matches any charcter in the \f3space\fP class.
+Matches any character in the \f3space\fP class.
 .TP
 .B \eS
-Matches any charcter not in the \f3space\fP class.
+Matches any character not in the \f3space\fP class.
 .TP
 .B \ew
-Matches any charcter in the \f3word\fP class.
+Matches any character in the \f3word\fP class.
 .TP
 .B \eW
-Matches any charcter not in the \f3word\fP class.
+Matches any character not in the \f3word\fP class.
 .PD
 .RE
 .PP
@@ -6115,7 +6115,7 @@
 All background jobs are run at a lower priority.
 This is the default mode.
 .TP 8
-.B breacexpand
+.B bracexpand
 Sans as
 .BR \-B .
 .TP 8
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/alias.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/alias.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/alias.sh       2005-05-24 
21:33:07.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/alias.sh       2006-06-28 
19:33:53.000000000 +0200
@@ -25,7 +25,7 @@
 }
 alias err_exit='err_exit $LINENO'
 
-Command=$0
+Command=${0##*/}
 integer Errors=0
 alias foo='print hello'
 if     [[ $(foo) != hello ]]
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/append.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/append.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/append.sh      2005-05-24 
21:33:12.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/append.sh      2006-06-28 
19:34:03.000000000 +0200
@@ -25,7 +25,7 @@
 }
 alias err_exit='err_exit $LINENO'
 
-Command=$0
+Command=${0##*/}
 integer Errors=0
 {
 x=abc
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/arith.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/arith.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/arith.sh       2006-06-15 
15:16:20.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/arith.sh       2006-06-29 
18:28:07.000000000 +0200
@@ -25,7 +25,8 @@
 }
 alias err_exit='err_exit $LINENO'
 
-Command=$0
+Command=${0##*/}
+trap '' FPE # NOTE: osf.alpha requires this (no ieee math)
 integer Errors=0
 integer x=1 y=2 z=3
 if     (( 2+2 != 4 ))
@@ -436,4 +437,22 @@
 (( x = 4*atan(1.0) ))
 [[ $x == "$((x))" ]] || err_exit  '$x !- $((x)) when x is pi'
 $SHELL -c  "[[  ${x//./} == {14,100}(\d) ]]" 2> /dev/null || err_exit 'pi has 
less than 14 significant places'
+if     (( Inf+1 == Inf ))
+then   [[ $(printf "%g\n" $((Inf))) == Inf ]] || err_exit 'printf "%g\n" 
$((Inf) fails'
+#      [[ $(printf "%g\n" $((Nan))) == Inf ]] || err_exit 'printf "%g\n" 
$((Nan) fails'
+       [[ $(printf "%g\n" Inf) == Inf ]] || err_exit 'printf "%g\n" Inf fails'
+       [[ $(printf "%g\n" NaN) == NaN ]] || err_exit 'printf "%g\n" NaN fails'
+       [[ $(print -- $((Inf))) == Inf ]] || err_exit 'print -- $((Inf)) fails'
+       (( 1.0/0.0 == Inf )) || err_exit '1.0/0.0 != Inf'
+       [[ $(print -- $((0.0/0.0))) == NaN ]] || err_exit '0.0/0.0 != NaN'
+       (( Inf*Inf == Inf )) || err_exit 'Inf*Inf != Inf'
+       (( NaN != NaN )) || err_exit 'NaN == NaN'
+       (( -5*Inf == -Inf )) || err_exit '-5*Inf != -Inf'
+       [[ $(print -- $((sqrt(-1.0)))) == NaN ]]|| err_exit 'sqrt(-1.0) != NaN'
+       (( pow(1.0,Inf) == 1.0 )) || err_exit 'pow(1.0,Inf) != 1.0'
+       (( pow(Inf,0.0) == 1.0 )) || err_exit 'pow(Inf,0.0) != 1.0'
+       [[ $(print -- $((NaN/Inf))) == NaN ]] || err_exit 'NaN/Inf != NaN'
+       (( 4.0/Inf == 0.0 )) || err_exit '4.0/Inf != 0.0'
+else   err_exit 'Inf and NaN not working'
+fi
 exit $((Errors))
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/arrays.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/arrays.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/arrays.sh      2005-05-24 
21:33:18.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/arrays.sh      2006-06-28 
19:34:09.000000000 +0200
@@ -34,7 +34,7 @@
        done
 }
 
-Command=$0
+Command=${0##*/}
 integer Errors=0
 set -A x zero one two three four 'five six'
 if     [[ $x != zero ]]
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/attributes.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/attributes.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/attributes.sh  2006-05-01 
02:57:04.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/attributes.sh  2006-06-28 
19:34:11.000000000 +0200
@@ -25,7 +25,7 @@
 }
 alias err_exit='err_exit $LINENO'
 
-Command=$0
+Command=${0##*/}
 integer Errors=0
 r=readonly u=Uppercase l=Lowercase i=22 i8=10 L=abc L5=def uL5=abcdef xi=20
 x=export t=tagged H=hostname LZ5=026 RZ5=026 Z5=123 lR5=ABcdef R5=def n=l
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/basic.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/basic.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/basic.sh       2006-02-15 
23:44:54.000000000 +0100
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/basic.sh       2006-06-28 
19:34:13.000000000 +0200
@@ -26,7 +26,7 @@
 alias err_exit='err_exit $LINENO'
 
 # test basic file operations like redirection, pipes, file expansion
-Command=$0
+Command=${0##*/}
 integer Errors=0
 umask u=rwx,go=rx || err_exit "umask u=rws,go=rx failed"
 if     [[ $(umask -S) != u=rwx,g=rx,o=rx ]]
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/bracket.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/bracket.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/bracket.sh     2006-05-18 
14:59:06.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/bracket.sh     2006-06-28 
20:44:08.000000000 +0200
@@ -25,7 +25,7 @@
 }
 alias err_exit='err_exit $LINENO'
 
-Command=$0
+Command=${0##*/}
 integer Errors=0
 null=''
 if     [[ ! -z $null ]]
@@ -170,7 +170,7 @@
 then   err_exit "setuid on $SHELL"
 fi
 if     [[ -g $SHELL ]]
-then   err_exit "setuid on $SHELL"
+then   err_exit "setgid on $SHELL"
 fi
 test -d .  -a '(' ! -f . ')' || err_exit 'test not working'
 if     [[ '!' != ! ]]
@@ -210,9 +210,7 @@
 ) || err_exit 'Errors with {..}(...) patterns'
 [[ D290.2003.02.16.temp == D290.+(2003.02.16).temp* ]] || err_exit 'pattern 
match bug with +(...)'
 rm -rf $file
-print > $file
 {
-cat $file > /dev/null # should make st_atime>st_mtime
 [[ -N $file ]] && err_exit 'test -N /tmp/*: st_mtime>st_atime after creat'
 sleep 2
 print 'hello world'
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/builtins.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/builtins.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/builtins.sh    2005-12-13 
23:40:03.000000000 +0100
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/builtins.sh    2006-06-28 
19:34:19.000000000 +0200
@@ -26,7 +26,7 @@
 alias err_exit='err_exit $LINENO'
 
 # test shell builtin commands
-Command=$0
+Command=${0##*/}
 integer Errors=0
 : ${foo=bar} || err_exit ": failed"
 [[ $foo = bar ]] || err_exit ": side effects failed"
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/case.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/case.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/case.sh        2005-05-24 
21:33:27.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/case.sh        2006-06-28 
19:34:21.000000000 +0200
@@ -25,7 +25,7 @@
 }
 alias err_exit='err_exit $LINENO'
 
-Command=$0
+Command=${0##*/}
 integer Errors=0
 
 bar=foo2
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/comvar.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/comvar.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/comvar.sh      2006-01-03 
05:29:50.000000000 +0100
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/comvar.sh      2006-06-28 
19:34:23.000000000 +0200
@@ -26,7 +26,7 @@
 alias err_exit='err_exit $LINENO'
 
 #test for compound variables
-Command=$0
+Command=${0##*/}
 integer Errors=0
 Point=(
        float x=1. y=0.
@@ -190,6 +190,6 @@
 point=(integer x=6 y=8)
 localvar
        (( (point.x*point.x + point.y*point.y) == 100 )) || err_exit "global 
compound variable not preserved"
-[[ $($SHELL -c 'foo=( [x]=(y z) ); print ${foo...@]}') == 'y z' ]] 2> 
/dev/null || err_exit 'foo=( [x]=(y z)  not working'
+[[ $($SHELL -c 'foo=();foo.[x]=(y z); print ${foo...@]}') == 'y z' ]] 2> 
/dev/null || err_exit 'foo=( [x]=(y z)  not working'
 exit $((Errors))
 
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/coprocess.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/coprocess.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/coprocess.sh   2006-06-09 
21:21:17.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/coprocess.sh   2006-06-28 
19:34:25.000000000 +0200
@@ -26,7 +26,7 @@
 }
 alias err_exit='err_exit $LINENO'
 
-Command=$0
+Command=${0##*/}
 integer Errors=0
 
 function ping # id
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/exit.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/exit.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/exit.sh        2005-05-24 
21:33:32.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/exit.sh        2006-06-28 
20:42:28.000000000 +0200
@@ -34,7 +34,7 @@
         print $newdir/$base
 }
 #test for proper exit of shell
-Command=$0
+Command=${0##*/}
 integer Errors=0
 ABSHELL=$(abspath)
 mkdir /tmp/ksh$$ || err_exit "mkdir /tmp/ksh$$ failed"
@@ -51,8 +51,11 @@
 SHLIBPATH=$SHLIBPATH \
 exec -c -a -ksh ${ABSHELL} -c "exit 1" 1>/dev/null 2>&1
 !
-if [[ $(echo $?) != 0 ]]
-then err_exit 'exit in .profile is ignored'
+status=$(echo $?)
+if     [[ -o noprivileged && $status != 0 ]]
+then   err_exit 'exit in .profile is ignored'
+elif   [[ -o privileged && $status == 0 ]]
+then   err_exit 'privileged .profile not ignored'
 fi
 if     [[ $(trap 'code=$?; echo $code; trap 0; exit $code' 0; exit 123) != 123 
]]
 then   err_exit 'exit not setting $?'
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/expand.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/expand.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/expand.sh      2005-05-24 
21:33:34.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/expand.sh      2006-06-28 
19:34:30.000000000 +0200
@@ -25,7 +25,7 @@
 }
 
 integer Errors=0
-Command=$0
+Command=${0##*/}
 
 # {...} expansion tests -- ignore if not supported
 
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/functions.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/functions.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/functions.sh   2006-03-28 
18:43:35.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/functions.sh   2006-06-28 
19:34:32.000000000 +0200
@@ -26,7 +26,7 @@
 alias err_exit='err_exit $LINENO'
 
 integer Errors=0
-Command=$0
+Command=${0##*/}
 integer foo=33
 bar=bye
 # check for global variables and $0
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/glob.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/glob.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/glob.sh        2005-05-24 
21:31:22.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/glob.sh        2006-06-28 
19:34:53.000000000 +0200
@@ -20,7 +20,7 @@
 function err_exit
 {
        print -u2 -n "\t"
-       print -u2 -r ${command}[$1]: "${@:2}"
+       print -u2 -r ${Command}[$1]: "${@:2}"
        ((errors++))
 }
 alias err_exit='err_exit $LINENO'
@@ -54,7 +54,7 @@
        fi
 }
 
-command=$0
+Command=${0##*/}
 tmp=/tmp/ksh$$
 integer errors=0
 unset undefined
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/grep.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/grep.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/grep.sh        2005-05-24 
21:33:37.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/grep.sh        2006-06-28 
19:35:04.000000000 +0200
@@ -25,7 +25,7 @@
 }
 alias err_exit='err_exit $LINENO'
 
-Command=$0
+Command=${0##*/}
 integer Errors=0
 
 function grep
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/heredoc.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/heredoc.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/heredoc.sh     2005-05-24 
21:33:39.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/heredoc.sh     2006-06-28 
19:35:07.000000000 +0200
@@ -25,7 +25,7 @@
 }
 alias err_exit='err_exit $LINENO'
 
-Command=$0
+Command=${0##*/}
 integer Errors=0
 f=/tmp/here1$$
 g=/tmp/here2$$
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/io.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/io.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/io.sh  2006-01-24 22:52:10.000000000 
+0100
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/io.sh  2006-06-28 19:35:09.000000000 
+0200
@@ -25,7 +25,7 @@
 }
 alias err_exit='err_exit $LINENO'
 
-Command=$0
+Command=${0##*/}
 integer Errors=0
 # cut here
 function fun
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/nameref.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/nameref.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/nameref.sh     2006-05-03 
06:14:02.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/nameref.sh     2006-06-28 
19:35:10.000000000 +0200
@@ -25,7 +25,7 @@
 }
 alias err_exit='err_exit $LINENO'
 
-Command=$0
+Command=${0##*/}
 integer Errors=0
 function checkref
 {
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/options.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/options.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/options.sh     2005-05-24 
21:33:57.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/options.sh     2006-06-28 
20:23:16.000000000 +0200
@@ -25,7 +25,7 @@
 }
 alias err_exit='err_exit $LINENO'
 
-Command=$0
+Command=${0##*/}
 integer Errors=0
 if     [[ $( ${SHELL-ksh} -s hello<<-\!
                print $1
@@ -49,40 +49,82 @@
 print $'function env_hit\n{\n\tprint OK\n}' > $rc
 
 export ENV=$rc
-[[ $(print env_hit | $SHELL 2>&1) == "OK" ]] &&
-       err_exit 'non-interactive 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" ]] &&
-       err_exit '+E reads $ENV file'
-[[ $(print env_hit | $SHELL --rc 2>&1) == "OK" ]] ||
-       err_exit '--rc ignores $ENV file'
-[[ $(print env_hit | $SHELL --norc 2>&1) == "OK" ]] &&
-       err_exit '--norc reads $ENV file'
+if     [[ -o privileged ]]
+then
+       [[ $(print env_hit | $SHELL 2>&1) == "OK" ]] &&
+               err_exit 'privileged nointeractive 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" ]] &&
+               err_exit 'privileged +E reads $ENV file'
+       [[ $(print env_hit | $SHELL --rc 2>&1) == "OK" ]] &&
+               err_exit 'privileged --rc reads $ENV file'
+       [[ $(print env_hit | $SHELL --norc 2>&1) == "OK" ]] &&
+               err_exit 'privileged --norc reads $ENV file'
+else
+       [[ $(print env_hit | $SHELL 2>&1) == "OK" ]] &&
+               err_exit 'nointeractive 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" ]] &&
+               err_exit '+E reads $ENV file'
+       [[ $(print env_hit | $SHELL --rc 2>&1) == "OK" ]] ||
+               err_exit '--rc ignores $ENV file'
+       [[ $(print env_hit | $SHELL --norc 2>&1) == "OK" ]] &&
+               err_exit '--norc reads $ENV file'
+fi
 
 export ENV=
-[[ $(print env_hit | HOME=$tmp $SHELL 2>&1) == "OK" ]] &&
-       err_exit 'non-interactive 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" ]] &&
-       err_exit '+E reads $HOME/.kshrc file'
-[[ $(print env_hit | HOME=$tmp $SHELL --rc 2>&1) == "OK" ]] &&
-       err_exit '--rc ignores empty $ENV'
-[[ $(print env_hit | HOME=$tmp $SHELL --norc 2>&1) == "OK" ]] &&
-       err_exit '--norc reads $HOME/.kshrc file'
+if     [[ -o privileged ]]
+then
+       [[ $(print env_hit | HOME=$tmp $SHELL 2>&1) == "OK" ]] &&
+               err_exit 'privileged nointeractive 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" ]] &&
+               err_exit 'privileged +E reads $HOME/.kshrc file'
+       [[ $(print env_hit | HOME=$tmp $SHELL --rc 2>&1) == "OK" ]] &&
+               err_exit 'privileged --rc ignores empty $ENV'
+       [[ $(print env_hit | HOME=$tmp $SHELL --norc 2>&1) == "OK" ]] &&
+               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'
+       [[ $(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" ]] &&
+               err_exit '+E reads $HOME/.kshrc file'
+       [[ $(print env_hit | HOME=$tmp $SHELL --rc 2>&1) == "OK" ]] &&
+               err_exit '--rc ignores empty $ENV'
+       [[ $(print env_hit | HOME=$tmp $SHELL --norc 2>&1) == "OK" ]] &&
+               err_exit '--norc reads $HOME/.kshrc file'
+fi
 
 unset ENV
-[[ $(print env_hit | HOME=$tmp $SHELL 2>&1) == "OK" ]] &&
-       err_exit 'non-interactive shell reads $HOME/.kshrc file'
-[[ $(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" ]] &&
-       err_exit '+E reads $HOME/.kshrc file'
-[[ $(print env_hit | HOME=$tmp $SHELL --rc 2>&1) == "OK" ]] ||
-       err_exit '--rc ignores $HOME/.kshrc file'
-[[ $(print env_hit | HOME=$tmp $SHELL --norc 2>&1) == "OK" ]] &&
-       err_exit '--norc reads $HOME/.kshrc file'
+if     [[ -o privileged ]]
+then
+       [[ $(print env_hit | HOME=$tmp $SHELL 2>&1) == "OK" ]] &&
+               err_exit 'privileged nointeractive 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" ]] &&
+               err_exit 'privileged +E reads $HOME/.kshrc file'
+       [[ $(print env_hit | HOME=$tmp $SHELL --rc 2>&1) == "OK" ]] &&
+               err_exit 'privileged --rc reads $HOME/.kshrc file'
+       [[ $(print env_hit | HOME=$tmp $SHELL --norc 2>&1) == "OK" ]] &&
+               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'
+       [[ $(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" ]] &&
+               err_exit '+E reads $HOME/.kshrc file'
+       [[ $(print env_hit | HOME=$tmp $SHELL --rc 2>&1) == "OK" ]] ||
+               err_exit '--rc ignores $HOME/.kshrc file'
+       [[ $(print env_hit | HOME=$tmp $SHELL --norc 2>&1) == "OK" ]] &&
+               err_exit '--norc reads $HOME/.kshrc file'
+fi
 
 rm -rf $tmp
 
@@ -94,13 +136,21 @@
        > bar/foo.c > bar/bam.c
        > foo/bam.c
        set -- **.c
-       [[ $* == 'bam.c bar.c' ]] || err_exit '**.c not working with -G option'
+       expected='bam.c bar.c'
+       [[ $* == $expected ]] ||
+               err_exit "-G **.c failed -- expected '$expected', got '$*'"
        set -- **
-       [[ $* == 'bam.c bar bar.c bar/bam.c bar/foo.c foo foo/bam.c' ]] || 
err_exit '** not working with -G option'
+       expected='bam.c bar bar.c bar/bam.c bar/foo.c foo foo/bam.c'
+       [[ $* == $expected ]] ||
+               err_exit "-G ** failed -- expected '$expected', got '$*'"
        set -- **/*.c
-       [[ $* == 'bam.c bar.c bar/bam.c bar/foo.c foo/bam.c' ]] || err_exit 
'**/*.c not working with -G option'
+       expected='bam.c bar.c bar/bam.c bar/foo.c foo/bam.c'
+       [[ $* == $expected ]] ||
+               err_exit "-G **/*.c failed -- expected '$expected', got '$*'"
        set -- **/bam.c
-       [[ $* == 'bam.c bar/bam.c foo/bam.c' ]] || err_exit '**/bam.c not 
working with -G option'
+       expected='bam.c bar/bam.c foo/bam.c'
+       [[ $* == $expected ]] ||
+               err_exit "-G **/bam.c failed -- expected '$expected', got '$*'"
        cd ~-
        rm -rf /tmp/ksh$$
 fi
@@ -109,14 +159,39 @@
 cd /tmp/ksh$$
 t="<$$>.profile.<$$>"
 echo "echo '$t'" > .profile
-[[ $(HOME=$PWD $SHELL -l </dev/null 2>&1) == *$t* ]] || err_exit '-l ignores 
.profile'
-[[ $(HOME=$PWD $SHELL --login </dev/null 2>&1) == *$t* ]] || err_exit '--login 
ignores .profile'
-[[ $(HOME=$PWD $SHELL --login-shell </dev/null 2>&1) == *$t* ]] || err_exit 
'--login-shell ignores .profile'
-[[ $(HOME=$PWD $SHELL --login_shell </dev/null 2>&1) == *$t* ]] || err_exit 
'--login_shell ignores .profile'
-[[ $(HOME=$PWD exec -a -ksh $SHELL </dev/null 2>&1) == *$t* ]]  || err_exit 
'exec -a -ksh ksh ignores .profile'
 cp $SHELL ./-ksh
-[[ $(HOME=$PWD ./-ksh -i </dev/null 2>&1) == *$t* ]] || err_exit './-ksh 
ignores .profile'
-[[ $(HOME=$PWD ./-ksh -ip </dev/null 2>&1) == *$t* ]] && err_exit './-ksh -p 
does not ignore .profile'
+if     [[ -o privileged ]]
+then
+       [[ $(HOME=$PWD $SHELL -l </dev/null 2>&1) == *$t* ]] &&
+               err_exit 'privileged -l reads .profile'
+       [[ $(HOME=$PWD $SHELL --login </dev/null 2>&1) == *$t* ]] &&
+               err_exit 'privileged --login reads .profile'
+       [[ $(HOME=$PWD $SHELL --login-shell </dev/null 2>&1) == *$t* ]] &&
+               err_exit 'privileged --login-shell reads .profile'
+       [[ $(HOME=$PWD $SHELL --login_shell </dev/null 2>&1) == *$t* ]] &&
+               err_exit 'privileged --login_shell reads .profile'
+       [[ $(HOME=$PWD exec -a -ksh $SHELL </dev/null 2>&1) == *$t* ]]  &&
+               err_exit 'privileged exec -a -ksh ksh reads .profile'
+       [[ $(HOME=$PWD ./-ksh -i </dev/null 2>&1) == *$t* ]] &&
+               err_exit 'privileged ./-ksh reads .profile'
+       [[ $(HOME=$PWD ./-ksh -ip </dev/null 2>&1) == *$t* ]] &&
+               err_exit 'privileged ./-ksh -p reads .profile'
+else
+       [[ $(HOME=$PWD $SHELL -l </dev/null 2>&1) == *$t* ]] ||
+               err_exit '-l ignores .profile'
+       [[ $(HOME=$PWD $SHELL --login </dev/null 2>&1) == *$t* ]] ||
+               err_exit '--login ignores .profile'
+       [[ $(HOME=$PWD $SHELL --login-shell </dev/null 2>&1) == *$t* ]] ||
+               err_exit '--login-shell ignores .profile'
+       [[ $(HOME=$PWD $SHELL --login_shell </dev/null 2>&1) == *$t* ]] ||
+               err_exit '--login_shell ignores .profile'
+       [[ $(HOME=$PWD exec -a -ksh $SHELL </dev/null 2>&1) == *$t* ]]  ||
+               err_exit 'exec -a -ksh ksh ignores .profile'
+       [[ $(HOME=$PWD ./-ksh -i </dev/null 2>&1) == *$t* ]] ||
+               err_exit './-ksh ignores .profile'
+       [[ $(HOME=$PWD ./-ksh -ip </dev/null 2>&1) == *$t* ]] &&
+               err_exit './-ksh -p does not ignore .profile'
+fi
 cd ~-
 rm -rf /tmp/ksh$$
 
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/path.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/path.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/path.sh        2006-01-20 
05:58:23.000000000 +0100
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/path.sh        2006-06-28 
19:35:20.000000000 +0200
@@ -25,8 +25,8 @@
 }
 alias err_exit='err_exit $LINENO'
 
+Command=${0##*/}
 integer Errors=0
-Command=$0
 mkdir /tmp/ksh$$
 cd /tmp/ksh$$
 trap "PATH=$PATH; cd /; rm -rf /tmp/ksh$$" EXIT
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/quoting2.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/quoting2.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/quoting2.sh    2005-05-24 
21:34:05.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/quoting2.sh    2006-06-28 
19:35:27.000000000 +0200
@@ -25,7 +25,7 @@
 }
 alias err_exit='err_exit $LINENO'
 
-Command=$0
+Command=${0##*/}
 integer Errors=0
 set -o noglob
 if     [[ 'hi there' != "hi there" ]]
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/quoting.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/quoting.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/quoting.sh     2005-05-24 
21:34:03.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/quoting.sh     2006-06-28 
19:35:24.000000000 +0200
@@ -25,7 +25,7 @@
 }
 alias err_exit='err_exit $LINENO'
 
-Command=$0
+Command=${0##*/}
 integer Errors=0
 if     [[ 'hi there' != "hi there" ]]
 then   err_exit "single quotes not the same as double quotes"
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/return.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/return.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/return.sh      2005-05-24 
21:34:07.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/return.sh      2006-06-28 
19:35:30.000000000 +0200
@@ -27,7 +27,7 @@
 }
 alias err_exit='err_exit $LINENO'
 
-Command=$0
+Command=${0##*/}
 integer Errors=0
 foo=NOVAL bar=NOVAL
 file=/tmp/shtest$$
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/select.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/select.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/select.sh      2005-05-24 
21:34:09.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/select.sh      2006-06-28 
19:35:33.000000000 +0200
@@ -25,7 +25,7 @@
 }
 alias err_exit='err_exit $LINENO'
 
-Command=$0
+Command=${0##*/}
 integer Errors=0
 trap "rm -f /tmp/Sh$$*" EXIT
 PS3='ABC '
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/shtests 
ksh93_2006_06_30/src/cmd/ksh93/tests/shtests
--- ksh93_2006_06_16/src/cmd/ksh93/tests/shtests        2005-04-12 
07:58:46.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/shtests        2006-06-28 
17:04:52.000000000 +0200
@@ -1,6 +1,6 @@
 # This program runs ksh regression tests
 
-unset ENV LANG LC_ALL
+unset ENV FIGNORE LANG LC_ALL
 export PATH PWD SHELL
 PWD=`pwd`
 SHELL=${SHELL-ksh}
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/substring.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/substring.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/substring.sh   2005-06-09 
01:04:19.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/substring.sh   2006-06-28 
19:35:36.000000000 +0200
@@ -25,7 +25,7 @@
 }
 alias err_exit='err_exit $LINENO'
 
-Command=$0
+Command=${0##*/}
 integer Errors=0 j=4
 base=/home/dgk/foo//bar
 string1=$base/abcabcabc
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/tilde.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/tilde.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/tilde.sh       2005-08-19 
21:54:51.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/tilde.sh       2006-06-28 
19:35:42.000000000 +0200
@@ -36,8 +36,8 @@
        fi
 }
 
+Command=${0##*/}
 integer Errors=0
-Command=$0
 OLDPWD=/bin
 if     [[ ~ != $HOME ]]
 then   err_exit '~' not $HOME
diff -r -N -u ksh93_2006_06_16/src/cmd/ksh93/tests/variables.sh 
ksh93_2006_06_30/src/cmd/ksh93/tests/variables.sh
--- ksh93_2006_06_16/src/cmd/ksh93/tests/variables.sh   2006-04-04 
22:47:23.000000000 +0200
+++ ksh93_2006_06_30/src/cmd/ksh93/tests/variables.sh   2006-06-28 
19:35:50.000000000 +0200
@@ -25,8 +25,8 @@
 }
 alias err_exit='err_exit $LINENO'
 
+Command=${0##*/}
 integer Errors=0
-Command=$0
 # RANDOM
 if     (( RANDOM==RANDOM || $RANDOM==$RANDOM ))
 then   err_exit RANDOM variable not working
diff -r -N -u ksh93_2006_06_16/src/lib/libast/features/float 
ksh93_2006_06_30/src/lib/libast/features/float
--- ksh93_2006_06_16/src/lib/libast/features/float      2005-02-21 
05:27:35.000000000 +0100
+++ ksh93_2006_06_30/src/lib/libast/features/float      2006-06-27 
18:50:37.000000000 +0200
@@ -944,7 +944,7 @@
        }
 }end
 
-tst    - -lm -DSCAN=1 - -DDIV=1 - -DEXP=1 - -DADD=1 - -DMPY=1 note{ INF and 
NAN memory representations }end output{
+tst    - -lm -DSTRTO=1 - -DSCAN=1 - -DDIV=1 - -DEXP=1 - -DADD=1 - -DMPY=1 
note{ INF and NAN memory representations }end output{
        #include "FEATURE/common"
        #include <sys/types.h>
        #include <signal.h>
@@ -960,6 +960,9 @@
        #if _hdr_values
        #include <values.h>
        #endif
+       #if STRTO && _hdr_stdlib
+       #include <stdlib.h>
+       #endif
        #if !defined(FLT_MAX) && defined(MAXFLOAT)
        #define FLT_MAX         MAXFLOAT
        #endif
@@ -991,38 +994,76 @@
        int
        main()
        {
-       #if SCAN
-       #define NANQ    "NaNQ"
+       #if SCAN || STRTO
+       #define NAN     "NaN"
        #define INF     "INF"
        {
                float   f;
 
-               if (sscanf(NANQ, "%g", &f) != 1)
+       #if SCAN
+               if (sscanf(NAN, "%g", &f) != 1)
                        return 1;
+       #else
+               f = atof(NAN);
+       #endif
                list("flt", "nan", &f, sizeof(f));
+       #if SCAN
                if (sscanf(INF, "%g", &f) != 1)
                        return 1;
+       #else
+               f = atof(INF);
+       #endif
                list("flt", "inf", &f, sizeof(f));
        }
        {
                double  f;
+       #if STRTO
+               char*   e;
+       #endif
 
-               if (sscanf(NANQ, "%lg", &f) != 1)
+       #if SCAN
+               if (sscanf(NAN, "%lg", &f) != 1)
                        return 1;
+       #else
+               f = strtod(NAN, &e);
+               if (*e)
+                       return 1;
+       #endif
                list("dbl", "nan", &f, sizeof(f));
+       #if SCAN
                if (sscanf(INF, "%lg", &f) != 1)
                        return 1;
+       #else
+               f = strtod(INF, &e);
+               if (*e)
+                       return 1;
+       #endif
                list("dbl", "inf", &f, sizeof(f));
        }
        #ifdef LDBL_MAX
        {
                long double     f;
+       #if STRTO
+               char*   e;
+       #endif
 
-               if (sscanf(NANQ, "%Lg", &f) != 1)
+       #if SCAN
+               if (sscanf(NAN, "%Lg", &f) != 1)
                        return 1;
+       #else
+               f = strtold(NAN, &e);
+               if (*e)
+                       return 1;
+       #endif
                list("ldbl", "nan", &f, sizeof(f));
+       #if SCAN
                if (sscanf(INF, "%Lg", &f) != 1)
                        return 1;
+       #else
+               f = strtold(INF, &e);
+               if (*e)
+                       return 1;
+       #endif
                list("ldbl", "inf", &f, sizeof(f));
        }
        #endif
diff -r -N -u ksh93_2006_06_16/src/lib/libast/features/fs 
ksh93_2006_06_30/src/lib/libast/features/fs
--- ksh93_2006_06_16/src/lib/libast/features/fs 2005-07-28 00:16:40.000000000 
+0200
+++ ksh93_2006_06_30/src/lib/libast/features/fs 2005-07-28 00:16:40.000000000 
+0200
@@ -203,6 +203,16 @@
                return statfs("/",&fs,sizeof(fs),0);
        }
 }end
+lib    getmntinfo_statvfs note{ getmntinfo uses statvfs -- since when? }end 
compile{
+       #include <sys/types.h>
+       #include <sys/mount.h>
+       int
+       gmi(struct statvfs* fs)
+       {
+               fs->f_flag = 0;
+               return getmntinfo(fs, 0);
+       }
+}end
 cat{
        #if _sys_statvfs
        #include <sys/statvfs.h>
diff -r -N -u ksh93_2006_06_16/src/lib/libast/features/map.c 
ksh93_2006_06_30/src/lib/libast/features/map.c
--- ksh93_2006_06_16/src/lib/libast/features/map.c      2005-05-24 
05:52:13.000000000 +0200
+++ ksh93_2006_06_30/src/lib/libast/features/map.c      2005-05-24 
05:52:13.000000000 +0200
@@ -23,6 +23,7 @@
 
 #include <stdio.h>
 
+#include "FEATURE/lib"
 #include "FEATURE/mmap"
 #include "FEATURE/vmalloc"
 
@@ -30,13 +31,23 @@
 main()
 {
 #if __MVS__
+#undef _map_libc
+#define _map_libc      1
        printf("\n");
        printf("/* mvs.390 libc.dll routines can't be intercepted by user dlls 
*/\n");
        printf("#undef  _mem_dd_fd_DIR\n");
        printf("#undef  _typ_long_double\n");
+#endif
+#if _map_libc
+#undef _map_malloc
+#define _map_malloc    1
+       printf("\n");
+       printf("#define _map_libc       1\n");
        printf("#define basename        _ast_basename\n");
        printf("#define dirname         _ast_dirname\n");
+#if !_lib_execvpe
        printf("#define execvpe         _ast_execvpe\n");
+#endif
        printf("#define fts_children    _ast_fts_children\n");
        printf("#define fts_close       _ast_fts_close\n");
        printf("#define fts_flags       _ast_fts_flags\n");
@@ -47,10 +58,16 @@
        printf("#define ftw             _ast_ftw\n");
        printf("#define ftwalk          _ast_ftwalk\n");
        printf("#define ftwflags        _ast_ftwflags\n");
+#if !_WINIX
        printf("#define getcwd          _ast_getcwd\n");
+#endif
        printf("#define getdate         _ast_getdate\n");
+#if !_lib_getopt
        printf("#define getopt          _ast_getopt\n");
+#endif
+#if !_lib_getsubopt
        printf("#define getsubopt       _ast_getsubopt\n");
+#endif
        printf("#define getwd           _ast_getwd\n");
        printf("#define glob            _ast_glob\n");
        printf("#define globfree        _ast_globfree\n");
@@ -82,9 +99,13 @@
        printf("#define resolvepath     _ast_resolvepath\n");
        printf("#define setenviron      _ast_setenviron\n");
        printf("#define strftime        _ast_strftime\n");
+#if !_lib_strptime
        printf("#define strptime        _ast_strptime\n");
+#endif
+#if !__CYGWIN__
        printf("#define strtol          _ast_strtol\n");
        printf("#define strtoul         _ast_strtoul\n");
+#endif
        printf("#define strtoll         _ast_strtoll\n");
        printf("#define strtoull        _ast_strtoull\n");
        printf("#define system          _ast_system\n");
diff -r -N -u ksh93_2006_06_16/src/lib/libast/Mamfile 
ksh93_2006_06_30/src/lib/libast/Mamfile
--- ksh93_2006_06_16/src/lib/libast/Mamfile     2006-06-16 11:07:58.000000000 
+0200
+++ ksh93_2006_06_30/src/lib/libast/Mamfile     2006-06-30 15:38:52.000000000 
+0200
@@ -1,4 +1,4 @@
-info mam static 00000 1994-07-17 make (AT&T Research) 5.1 2006-05-09
+info mam static 00000 1994-07-17 make (AT&T Research) 5.1 2006-05-21
 setv INSTALLROOT ../../..
 setv PACKAGEROOT ../../../../..
 setv AR ar
@@ -381,6 +381,7 @@
 done FEATURE/mmap dontcare generated
 done FEATURE/vmalloc generated
 prev FEATURE/mmap implicit
+prev FEATURE/lib implicit
 prev std/stdio.h implicit
 done features/map.c
 prev ast.req
diff -r -N -u ksh93_2006_06_16/src/lib/libast/port/astmath.c 
ksh93_2006_06_30/src/lib/libast/port/astmath.c
--- ksh93_2006_06_16/src/lib/libast/port/astmath.c      2005-02-09 
05:35:08.000000000 +0100
+++ ksh93_2006_06_30/src/lib/libast/port/astmath.c      2006-06-27 
22:47:49.000000000 +0200
@@ -33,7 +33,7 @@
 main()
 {
 #if N & 1
-       long double     valuel = 0;
+       long double     value = 0;
 #else
        double          value = 0;
 #endif
@@ -42,19 +42,19 @@
 #endif
 
 #if N == 1
-       return ldexpl(valuel, exp) != 0;
+       return ldexpl(value, exp) != 0;
 #endif
 #if N == 2
        return ldexp(value, exp) != 0;
 #endif
 #if N == 3
-       return frexpl(valuel, &exp) != 0;
+       return frexpl(value, &exp) != 0;
 #endif
 #if N == 4
        return frexp(value, &exp) != 0;
 #endif
 #if N == 5
-       return isnanl(valuel);
+       return isnan(value);
 #endif
 #if N == 6
        return isnan(value);
diff -r -N -u ksh93_2006_06_16/src/lib/libast/port/mnt.c 
ksh93_2006_06_30/src/lib/libast/port/mnt.c
--- ksh93_2006_06_16/src/lib/libast/port/mnt.c  2005-02-11 16:58:38.000000000 
+0100
+++ ksh93_2006_06_30/src/lib/libast/port/mnt.c  2006-06-20 01:58:07.000000000 
+0200
@@ -137,11 +137,18 @@
  * what a crappy interface
  * data returned in static buffer -- ok
  * big chunk of allocated memory that cannot be freed -- come on
+ * *and* netbsd changed the interface somewhere along the line
+ * private interface? my bad -- public interface? par for the bsd course
  */
 
 #include <sys/param.h>         /* expect some macro redefinitions here */
 #include <sys/mount.h>
 
+#if _lib_getmntinfo_statvfs
+#define statfs         statvfs
+#define f_flags                f_flag
+#endif
+
 typedef struct
 {
        Header_t        hdr;
diff -r -N -u ksh93_2006_06_16/src/lib/libast/regex/regstat.c 
ksh93_2006_06_30/src/lib/libast/regex/regstat.c
--- ksh93_2006_06_16/src/lib/libast/regex/regstat.c     2003-09-17 
14:43:04.000000000 +0200
+++ ksh93_2006_06_30/src/lib/libast/regex/regstat.c     2006-06-20 
00:22:59.000000000 +0200
@@ -30,6 +30,17 @@
 regstat_t*
 regstat(const regex_t* p)
 {
+       register Rex_t* e;
+
+       e = p->env->rex;
+       if (e && e->type == REX_BM)
+               e = e->next;
+       if (e && e->type == REX_BEG)
+               e = e->next;
+       if (e && e->type == REX_STRING)
+               e = e->next;
+       if (!e || e->type == REX_END && !e->next)
+               p->env->stats.re_flags |= REG_LITERAL;
        p->env->stats.re_record = (p && p->env && p->env->rex->type == REX_BM) 
? p->env->rex->re.bm.size : -1;
        return &p->env->stats;
 }
diff -r -N -u ksh93_2006_06_16/src/lib/libast/RELEASE 
ksh93_2006_06_30/src/lib/libast/RELEASE
--- ksh93_2006_06_16/src/lib/libast/RELEASE     2006-06-12 21:39:42.000000000 
+0200
+++ ksh93_2006_06_30/src/lib/libast/RELEASE     2006-06-28 10:14:07.000000000 
+0200
@@ -1,6 +1,12 @@
+06-06-27 features/float,sfio/sfcvt.c: fix Nan logic
+06-06-27 port/astmath.c: fix long double isnan() test
+06-06-27 features/map.c: _map_libc for std => _ast_std
+06-06-25 string/strperm.c: handle posix = w.r.t. umask
+06-06-19 port/mnt.c,features/fs: handle netbsd getmntent api change
+06-06-18 regex/regstat.c: add REG_LITERAL check
 06-06-11 cdt/dtview.c: update from kpv
 06-05-31 sfio/sfhdr.h: fix _SFOPEN() typo
-06-05-09 comp/comf.sh: add native getconf -a names to the mix
+06-05-09 comp/conf.sh: add native getconf -a names to the mix
 06-04-28 misc/optget.c: add solaris long option name compatibility
 06-03-09 string/strmatch.c: add REG_ADVANCE => REG_* flags
 06-02-14 comp/iconv.c: fix uwin iconv_list() /reg/ generator
diff -r -N -u ksh93_2006_06_16/src/lib/libast/sfio/sfcvt.c 
ksh93_2006_06_30/src/lib/libast/sfio/sfcvt.c
--- ksh93_2006_06_16/src/lib/libast/sfio/sfcvt.c        2005-02-08 
23:41:26.000000000 +0100
+++ ksh93_2006_06_30/src/lib/libast/sfio/sfcvt.c        2006-06-27 
18:58:16.000000000 +0200
@@ -32,11 +32,13 @@
 #define SF_ZERO                ((_Sfi = 1), Zero)
 #define SF_NAN         ((_Sfi = 3), Nan)
 
+#if ! _lib_isnan
+#define isnan(n)       (memcmp((void*)&n,(void*)&_Sfdnan,sizeof(n))==0)
+#define isnanl(n)      (memcmp((void*)&n,(void*)&_Sflnan,sizeof(n))==0)
+#else
 #if ! _lib_isnanl
-#define isnanl(n)      ((n)==_Sflnan)
+#define isnanl(n)      isnan(n)
 #endif
-#if ! _lib_isnan
-#define isnan(n)       ((n)==_Sfdnan)
 #endif
 
 #if __STD_C
diff -r -N -u ksh93_2006_06_16/src/lib/libast/string/strperm.c 
ksh93_2006_06_30/src/lib/libast/string/strperm.c
--- ksh93_2006_06_16/src/lib/libast/string/strperm.c    2004-08-26 
07:19:26.000000000 +0200
+++ ksh93_2006_06_30/src/lib/libast/string/strperm.c    2006-06-25 
19:16:32.000000000 +0200
@@ -77,6 +77,11 @@
                                expr--;
                                /*FALLTHROUGH*/
                        case '=':
+                               if (who)
+                                       perm &= ~who;
+                               else
+                                       perm = 0;
+                               /*FALLTHROUGH*/
                        case '+':
                        case '|':
                        case '-':
@@ -111,7 +116,7 @@
                                                {
                                                        if (e)
                                                                *e = expr - 1;
-                                                       return perm;
+                                                       return perm & S_IPERM;
                                                }
                                                typ |= S_ISGID;
                                                continue;
@@ -128,6 +133,7 @@
                                                else
                                                        switch (op)
                                                        {
+                                                       case '=':
                                                        case '+':
                                                        case '|':
                                                        case '-':
@@ -228,7 +234,7 @@
                                                                }
                                                                perm |= typ;
                                                        }
-                                                       return perm;
+                                                       return perm & S_IPERM;
                                                }
                                                num = (num << 3) | (c - '0');
                                                if (*expr < '0' || *expr > '7')
diff -r -N -u ksh93_2006_06_16/src/lib/libcmd/chmod.c 
ksh93_2006_06_30/src/lib/libcmd/chmod.c
--- ksh93_2006_06_16/src/lib/libcmd/chmod.c     2005-02-16 07:40:23.000000000 
+0100
+++ ksh93_2006_06_30/src/lib/libcmd/chmod.c     2006-06-25 19:17:59.000000000 
+0200
@@ -28,7 +28,7 @@
  */
 
 static const char usage[] =
-"[-?\n@(#)$Id: chmod (AT&T Labs Research) 2005-02-14 $\n]"
+"[-?\n@(#)$Id: chmod (AT&T Labs Research) 2006-06-25 $\n]"
 USAGE_LICENSE
 "[+NAME?chmod - change the access permissions of files]"
 "[+DESCRIPTION?\bchmod\b changes the permission of each file "
@@ -276,7 +276,7 @@
                                mode = strperm(amode, &last, 
ent->fts_statp->st_mode);
                        if ((*chmodf)(ent->fts_accpath, mode) >= 0)
                        {
-                               if (notify == 2 || notify == 1 && mode != 
(ent->fts_statp->st_mode&S_IPERM))
+                               if (notify == 2 || notify == 1 && 
(mode&S_IPERM) != (ent->fts_statp->st_mode&S_IPERM))
                                        sfprintf(sfstdout, "%s: mode changed to 
%0.4o (%s)\n", ent->fts_accpath, mode, fmtmode(mode, 1)+1);
                        }
                        else if (!force)
diff -r -N -u ksh93_2006_06_16/src/lib/libcmd/Mamfile 
ksh93_2006_06_30/src/lib/libcmd/Mamfile
--- ksh93_2006_06_16/src/lib/libcmd/Mamfile     2006-06-16 11:08:14.000000000 
+0200
+++ ksh93_2006_06_30/src/lib/libcmd/Mamfile     2006-06-30 15:39:05.000000000 
+0200
@@ -1,4 +1,4 @@
-info mam static 00000 1994-07-17 make (AT&T Research) 5.1 2006-05-09
+info mam static 00000 1994-07-17 make (AT&T Research) 5.1 2006-05-21
 setv INSTALLROOT ../../..
 setv PACKAGE_ast_INCLUDE ${INSTALLROOT}/include/ast
 setv PACKAGE_ast_LIB ${INSTALLROOT}/lib
diff -r -N -u ksh93_2006_06_16/src/lib/libcmd/RELEASE 
ksh93_2006_06_30/src/lib/libcmd/RELEASE
--- ksh93_2006_06_16/src/lib/libcmd/RELEASE     2006-05-18 16:45:12.000000000 
+0200
+++ ksh93_2006_06_30/src/lib/libcmd/RELEASE     2006-06-25 19:15:05.000000000 
+0200
@@ -1,3 +1,4 @@
+06-06-25 chmod.c: mask -c output with S_IPERM
 06-05-09 uname.c: add -o; change -a to match linux
 06-05-03 date.c: add --last -L to list last of multiple time args
 06-02-14 tail.c: fix -f bug that lost fast stream data
diff -r -N -u ksh93_2006_06_16/src/lib/libdll/Mamfile 
ksh93_2006_06_30/src/lib/libdll/Mamfile
--- ksh93_2006_06_16/src/lib/libdll/Mamfile     2006-06-16 11:08:18.000000000 
+0200
+++ ksh93_2006_06_30/src/lib/libdll/Mamfile     2006-06-30 15:39:08.000000000 
+0200
@@ -1,4 +1,4 @@
-info mam static 00000 1994-07-17 make (AT&T Research) 5.1 2006-05-09
+info mam static 00000 1994-07-17 make (AT&T Research) 5.1 2006-05-21
 setv INSTALLROOT ../../..
 setv PACKAGE_ast_INCLUDE ${INSTALLROOT}/include/ast
 setv PACKAGE_ast_LIB ${INSTALLROOT}/lib

Reply via email to