On Fri, 14 May 2010 17:53 -0400, "David Korn" <[email protected]> wrote: > > > If flags does not contain NV_NOFREE, then it is safe to use a pointer > since the shell will make a private copy and free it when another > assignment is given. > > The variable will not be exported unless it is already exported or if > flag contains NV_EXPORT. Otherwise, it will be a local variable.
OK, thanks for your help. One thing I should report: the builtin was orginally developed for ast-ksh 2001-10-31 and used stakalloc'd memory for both name and value passed to nv_putval. Flags were NV_ASSIGN|NV_IDENT|NV_EXPORT. When porting this code to ast-ksh 2010-03-09, we found that the value of environment variables tended to get corrupted inside the while loop - and assumed this to be because the stakalloc'd memory had been routinely invalidated by the shell upon exit of the builtin. Will the shell not make a copy if the memory is stakalloc'd? Thanks, Carl _______________________________________________ ast-developers mailing list [email protected] https://mailman.research.att.com/mailman/listinfo/ast-developers
