summaryrefslogtreecommitdiff
path: root/usr/src/lib/libshell/common/sh/expand.c
diff options
context:
space:
mode:
authorApril Chin <April.Chin@Sun.COM>2008-12-27 14:59:38 -0800
committerApril Chin <April.Chin@Sun.COM>2008-12-27 14:59:38 -0800
commit7c2fbfb345896881c631598ee3852ce9ce33fb07 (patch)
tree4b173b5657508562dfc0aa05f7d056d1e9add505 /usr/src/lib/libshell/common/sh/expand.c
parent6071ac1de68fed78e1e10052045bbb5f1732a263 (diff)
downloadillumos-gate-7c2fbfb345896881c631598ee3852ce9ce33fb07.tar.gz
PSARC/2008/094 ksh93 Update 1
PSARC/2008/344 ksh93 Integration Update 1 Amendments 1 PSARC/2008/589 Remove /usr/bin/printf from PSARC case 2008 094 6619428 *ksh93* RFE: Update ksh93 in Solaris to ast-ksh.2008-11-04 6788659 RFE: Update libpp in Solaris to ast-open.2008-07-25 6561901 RFE: Add "shcomp" (shell script compiler) + kernel module to exec binary sh code 6599668 RFE: Move consumers of alias.sh over to ksh93 6595183 *ksh93* RFE: Update ksh93-integration demo code 6775901 *ksh93* no C message catalogs are generated for ksh93 6451262 *sleep* RFE: /usr/bin/sleep should support floating-point values 6687139 *ksh93* command substitution, exec, and stdout redirection cause allocation loop 6703761 *ksh93* crashes in script containing uncommon output redirections 6715496 *ksh93* SEGVs on array reinitialization 6713682 *ksh93* Creating a compound variable in a subshell "bleeds through" to the calling subshell 6672350 *ksh93* causes parent shell to die when child shell is suspended 6745015 *ksh93* VARIABLE=`command substitution` assignment is not reliable on OpenSolaris 6710205 *ksh93* problem with command substitution (within back quotes) containing \$' 6737600 *ksh93* exits debugger when user presses ctrl-c 6748645 *ksh93* fc -l -e - is mis-parsed, outputs wrong error message "-e - requires single argument" 6754020 *ksh93* does weird '[' expansion 6753538 *ksh93* umask modification leaks out of a ksh93 subshell 6766246 *ksh93* bug in pattern matching 6763594 *ksh93* executes command after "command" builtin twice on failure 6762665 *ksh93* Difficult-to-reproduce SIGSEGV in ksh93
Diffstat (limited to 'usr/src/lib/libshell/common/sh/expand.c')
-rw-r--r--usr/src/lib/libshell/common/sh/expand.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/usr/src/lib/libshell/common/sh/expand.c b/usr/src/lib/libshell/common/sh/expand.c
index 097ed0da66..15004a09be 100644
--- a/usr/src/lib/libshell/common/sh/expand.c
+++ b/usr/src/lib/libshell/common/sh/expand.c
@@ -1,10 +1,10 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2007 AT&T Knowledge Ventures *
+* Copyright (c) 1982-2008 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
-* by AT&T Knowledge Ventures *
+* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* http://www.opensource.org/licenses/cpl1.0.txt *
@@ -90,6 +90,7 @@ static char *nextdir(glob_t *gp, char *dir)
int path_expand(const char *pattern, struct argnod **arghead)
{
+ Shell_t *shp = &sh;
glob_t gdata;
register struct argnod *ap;
register glob_t *gp= &gdata;
@@ -98,6 +99,7 @@ int path_expand(const char *pattern, struct argnod **arghead)
register int off;
register char *sp, *cp, *cp2;
#endif
+ sh_stats(STAT_GLOBS);
memset(gp,0,sizeof(gdata));
flags = GLOB_AUGMENTED|GLOB_NOCHECK|GLOB_NOSORT|GLOB_STACK|GLOB_LIST|GLOB_DISC;
if(sh_isoption(SH_MARKDIRS))
@@ -117,8 +119,8 @@ int path_expand(const char *pattern, struct argnod **arghead)
if(sh_isstate(SH_COMPLETE))
{
#if KSHELL
- extra += scantree(sh.alias_tree,pattern,arghead);
- extra += scantree(sh.fun_tree,pattern,arghead);
+ extra += scantree(shp->alias_tree,pattern,arghead);
+ extra += scantree(shp->fun_tree,pattern,arghead);
# if GLOB_VERSION >= 20010916L
gp->gl_nextdir = nextdir;
# endif
@@ -139,13 +141,13 @@ int path_expand(const char *pattern, struct argnod **arghead)
* Generate shell patterns out of those here.
*/
if(sh_isstate(SH_FCOMPLETE))
- cp=nv_getval(nv_scoped(FIGNORENOD));
+ cp=nv_getval(sh_scoped(shp,FIGNORENOD));
else
{
static Namval_t *GLOBIGNORENOD;
if(!GLOBIGNORENOD)
- GLOBIGNORENOD = nv_open("GLOBIGNORE",sh.var_tree,0);
- cp=nv_getval(nv_scoped(GLOBIGNORENOD));
+ GLOBIGNORENOD = nv_open("GLOBIGNORE",shp->var_tree,0);
+ cp=nv_getval(sh_scoped(shp,GLOBIGNORENOD));
}
if(cp)
{
@@ -182,10 +184,10 @@ int path_expand(const char *pattern, struct argnod **arghead)
}
else
#endif
- gp->gl_fignore = nv_getval(nv_scoped(FIGNORENOD));
+ gp->gl_fignore = nv_getval(sh_scoped(shp,FIGNORENOD));
if(suflen)
gp->gl_suffix = sufstr;
- gp->gl_intr = &sh.trapnote;
+ gp->gl_intr = &shp->trapnote;
suflen = 0;
if(memcmp(pattern,"~(N",3)==0)
flags &= ~GLOB_NOCHECK;