1 /***********************************************************************
3 * This software is part of the ast package *
4 * Copyright (c) 1982-2010 AT&T Intellectual Property *
5 * and is licensed under the *
6 * Common Public License, Version 1.0 *
7 * by AT&T Intellectual Property *
9 * A copy of the License is available at *
10 * http://www.opensource.org/licenses/cpl1.0.txt *
11 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
13 * Information and Software Systems Research *
17 * David Korn <dgk@research.att.com> *
19 ***********************************************************************/
25 * Rewritten by David Korn
35 #include "FEATURE/poll"
39 #endif /* SHOPT_KIA */
46 # define BASHOPT "\374"
61 /* The following order is determined by sh_optset */
62 static const char optksh
[] = PFSHOPT BASHOPT
"DircabefhkmnpstuvxBCGEl" HFLAG
;
63 static const int flagval
[] =
71 SH_DICTIONARY
, SH_INTERACTIVE
, SH_RESTRICTED
, SH_CFLAG
,
72 SH_ALLEXPORT
, SH_NOTIFY
, SH_ERREXIT
, SH_NOGLOB
, SH_TRACKALL
,
73 SH_KEYWORD
, SH_MONITOR
, SH_NOEXEC
, SH_PRIVILEGED
, SH_SFLAG
, SH_TFLAG
,
74 SH_NOUNSET
, SH_VERBOSE
, SH_XTRACE
, SH_BRACEEXPAND
, SH_NOCLOBBER
,
75 SH_GLOBSTARS
, SH_RC
, SH_LOGIN_SHELL
,
82 #define NUM_OPTS (sizeof(flagval)/sizeof(*flagval))
87 struct dolnod
*argfor
; /* linked list of blocks to be cleaned up */
89 char flagadr
[NUM_OPTS
+1];
92 #endif /* SHOPT_KIA */
95 static int arg_expand(Shell_t
*,struct argnod
*,struct argnod
**,int);
96 static void sh_argset(Arg_t
*, char *[]);
99 /* ======== option handling ======== */
101 void *sh_argopen(Shell_t
*shp
)
103 void *addr
= newof(0,Arg_t
,1,0);
104 Arg_t
*ap
= (Arg_t
*)addr
;
109 static int infof(Opt_t
* op
, Sfio_t
* sp
, const char* s
, Optdisc_t
* dp
)
112 extern const char sh_bash1
[], sh_bash2
[];
113 if(strcmp(s
,"bash1")==0)
115 if(sh_isoption(SH_BASH
))
116 sfputr(sp
,sh_bash1
,-1);
118 else if(strcmp(s
,"bash2")==0)
120 if(sh_isoption(SH_BASH
))
121 sfputr(sp
,sh_bash2
,-1);
123 else if(*s
==':' && sh_isoption(SH_BASH
))
128 sfputr(sp
,sh_set
,-1);
133 * This routine turns options on and off
134 * The options "PDicr" are illegal from set command.
135 * The -o option is used to set option by name
136 * This routine returns the number of non-option arguments
138 int sh_argopts(int argc
,register char *argv
[], void *context
)
140 Shell_t
*shp
= (Shell_t
*)context
;
142 register Arg_t
*ap
= (Arg_t
*)(shp
->arg_context
);
143 Lex_t
*lp
= (Lex_t
*)(shp
->lex_context
);
145 int setflag
=0, action
=0, trace
=(int)sh_isoption(SH_XTRACE
);
146 Namval_t
*np
= NIL(Namval_t
*);
150 newflags
=ap
->sh
->options
;
151 memset(&disc
, 0, sizeof(disc
));
152 disc
.version
= OPT_VERSION
;
154 opt_info
.disc
= &disc
;
160 while((n
= optget(argv
,setflag
?sh_optset
:sh_optksh
)))
163 f
=*opt_info
.option
=='-' && (opt_info
.num
|| opt_info
.arg
);
167 np
= nv_open(opt_info
.arg
,ap
->sh
->var_tree
,NV_NOASSIGN
|NV_ARRAY
|NV_VARNAME
);
172 case 'O': /* shopt options, only in bash mode */
173 if(!sh_isoption(SH_BASH
))
174 errormsg(SH_DICT
,ERROR_exit(1), e_option
, opt_info
.name
);
176 case 'o': /* set options */
178 if(!opt_info
.arg
||!*opt_info
.arg
||*opt_info
.arg
=='-')
181 /* print style: -O => shopt options
182 * bash => print unset options also, no heading
184 verbose
= (f
?PRINT_VERBOSE
:PRINT_NO_HEADER
)|
185 (n
=='O'?PRINT_SHOPT
:0)|
186 (sh_isoption(SH_BASH
)?PRINT_ALL
|PRINT_NO_HEADER
:0)|
187 ((opt_info
.arg
&&(!*opt_info
.arg
||*opt_info
.arg
=='-'))?(PRINT_TABLE
|PRINT_NO_HEADER
):0);
190 o
= sh_lookopt(opt_info
.arg
,&f
);
192 || (!sh_isoption(SH_BASH
) && (o
&SH_BASHEXTRA
))
193 || ((!sh_isoption(SH_BASH
) || n
=='o') && (o
&SH_BASHOPT
))
195 || (setflag
&& (o
&SH_COMMANDLINE
)))
197 errormsg(SH_DICT
,2, e_option
, opt_info
.arg
);
201 if(sh_isoption(SH_RESTRICTED
) && !f
&& o
==SH_RESTRICTED
)
202 errormsg(SH_DICT
,ERROR_exit(1), e_restricted
, opt_info
.arg
);
205 case -1: /* --rcfile */
206 ap
->sh
->rcfile
= opt_info
.arg
;
208 case -2: /* --noediting */
211 off_option(&newflags
,SH_VI
);
212 off_option(&newflags
,SH_EMACS
);
213 off_option(&newflags
,SH_GMACS
);
216 case -3: /* --profile */
219 case -4: /* --posix */
220 /* mask lower 8 bits to find char in optksh string */
223 case -5: /* --version */
224 sfputr(sfstdout
, "ksh bash emulation, version ",-1);
225 np
= nv_open("BASH_VERSION",ap
->sh
->var_tree
,0);
226 sfputr(sfstdout
, nv_getval(np
),-1);
227 np
= nv_open("MACHTYPE",ap
->sh
->var_tree
,0);
228 sfprintf(sfstdout
, " (%s)\n", nv_getval(np
));
231 case -6: /* --default */
233 register const Shtable_t
*tp
;
234 for(tp
=shtab_options
; o
= tp
->sh_number
; tp
++)
235 if(!(o
&SH_COMMANDLINE
) && is_option(&newflags
,o
&0xff))
236 off_option(&newflags
,o
&0xff);
243 on_option(&newflags
,SH_NOEXEC
);
247 ap
->sh
->test
|= opt_info
.num
;
264 ap
->kiafile
= opt_info
.arg
;
268 #endif /* SHOPT_KIA */
273 #endif /* SHOPT_REGRESS */
276 if(cp
=strchr(optksh
,n
))
277 o
= flagval
[cp
-optksh
];
280 if(opt_info
.name
[0]=='-'&&opt_info
.name
[1]=='-')
282 opt_info
.arg
= argv
[opt_info
.index
-1] + 2;
286 errormsg(SH_DICT
,2, "%s", opt_info
.arg
);
289 errormsg(SH_DICT
,ERROR_usage(0), "%s", opt_info
.arg
);
294 if(o
==SH_VI
|| o
==SH_EMACS
|| o
==SH_GMACS
)
296 off_option(&newflags
,SH_VI
);
297 off_option(&newflags
,SH_EMACS
);
298 off_option(&newflags
,SH_GMACS
);
300 on_option(&newflags
,o
);
301 off_option(&ap
->sh
->offoptions
,o
);
307 off_option(&newflags
,o
);
309 on_option(&ap
->sh
->offoptions
,o
);
312 if(error_info
.errors
)
313 errormsg(SH_DICT
,ERROR_usage(2),"%s",optusage(NIL(char*)));
314 /* check for '-' or '+' argument */
315 if((cp
=argv
[opt_info
.index
]) && cp
[1]==0 && (*cp
=='+' || *cp
=='-') &&
316 strcmp(argv
[opt_info
.index
-1],"--"))
319 off_option(&newflags
,SH_XTRACE
);
320 off_option(&newflags
,SH_VERBOSE
);
325 argc
-= opt_info
.index
;
326 argv
+= opt_info
.index
;
328 sh_printopts(newflags
,verbose
,0);
334 strsort(argv
,argc
,strcoll
);
336 strsort(ap
->sh
->st
.dolv
+1,ap
->sh
->st
.dolc
,strcoll
);
340 nv_setvec(np
,0,argc
,argv
);
343 else if(argc
>0 || ((cp
=argv
[-1]) && strcmp(cp
,"--")==0))
344 sh_argset(ap
,argv
-1);
346 else if(is_option(&newflags
,SH_CFLAG
))
348 if(!(ap
->sh
->comdiv
= *argv
++))
350 errormsg(SH_DICT
,2,e_cneedsarg
);
351 errormsg(SH_DICT
,ERROR_usage(2),optusage(NIL(char*)));
355 /* handling SH_INTERACTIVE and SH_PRIVILEGED has been moved to
356 * sh_applyopts(), so that the code can be reused from b_shopt(), too
358 sh_applyopts(ap
->sh
,newflags
);
363 errormsg(SH_DICT
,ERROR_usage(2),"-R requires scriptname");
364 if(!(lp
->kiafile
=sfopen(NIL(Sfio_t
*),ap
->kiafile
,"w+")))
365 errormsg(SH_DICT
,ERROR_system(3),e_create
,ap
->kiafile
);
366 if(!(lp
->kiatmp
=sftmp(2*SF_BUFSIZE
)))
367 errormsg(SH_DICT
,ERROR_system(3),e_tmpcreate
);
368 sfputr(lp
->kiafile
,";vdb;CIAO/ksh",'\n');
369 lp
->kiabegin
= sftell(lp
->kiafile
);
370 lp
->entity_tree
= dtopen(&_Nvdisc
,Dtbag
);
371 lp
->scriptname
= strdup(sh_fmtq(argv
[0]));
372 lp
->script
=kiaentity(lp
,lp
->scriptname
,-1,'p',-1,0,0,'s',0,"");
373 lp
->fscript
=kiaentity(lp
,lp
->scriptname
,-1,'f',-1,0,0,'s',0,"");
374 lp
->unknown
=kiaentity(lp
,"<unknown>",-1,'p',-1,0,0,'0',0,"");
375 kiaentity(lp
,"<unknown>",-1,'p',0,0,lp
->unknown
,'0',0,"");
376 lp
->current
= lp
->script
;
379 #endif /* SHOPT_KIA */
383 /* apply new options */
385 void sh_applyopts(Shell_t
* shp
,Shopt_t newflags
)
387 /* cannot set -n for interactive shells since there is no way out */
388 if(sh_isoption(SH_INTERACTIVE
))
389 off_option(&newflags
,SH_NOEXEC
);
390 if(is_option(&newflags
,SH_PRIVILEGED
))
391 on_option(&newflags
,SH_NOUSRPROFILE
);
392 if(!sh_isstate(SH_INIT
) && is_option(&newflags
,SH_PRIVILEGED
) != sh_isoption(SH_PRIVILEGED
) || sh_isstate(SH_INIT
) && is_option(&((Arg_t
*)shp
->arg_context
)->sh
->offoptions
,SH_PRIVILEGED
) && shp
->userid
!=shp
->euserid
)
394 if(!is_option(&newflags
,SH_PRIVILEGED
))
397 setgid(shp
->groupid
);
400 shp
->euserid
= shp
->userid
;
401 shp
->egroupid
= shp
->groupid
;
404 else if((shp
->userid
!=shp
->euserid
&& setuid(shp
->euserid
)<0) ||
405 (shp
->groupid
!=shp
->egroupid
&& setgid(shp
->egroupid
)<0) ||
406 (shp
->userid
==shp
->euserid
&& shp
->groupid
==shp
->egroupid
))
407 off_option(&newflags
,SH_PRIVILEGED
);
410 on_option(&newflags
,SH_CMDHIST
);
411 on_option(&newflags
,SH_CHECKHASH
);
412 on_option(&newflags
,SH_EXECFAIL
);
413 on_option(&newflags
,SH_EXPAND_ALIASES
);
414 on_option(&newflags
,SH_HISTAPPEND
);
415 on_option(&newflags
,SH_INTERACTIVE_COMM
);
416 on_option(&newflags
,SH_LITHIST
);
417 on_option(&newflags
,SH_NOEMPTYCMDCOMPL
);
419 if(!is_option(&newflags
,SH_XPG_ECHO
) && sh_isoption(SH_XPG_ECHO
))
420 astconf("UNIVERSE", 0, "ucb");
421 if(is_option(&newflags
,SH_XPG_ECHO
) && !sh_isoption(SH_XPG_ECHO
))
422 astconf("UNIVERSE", 0, "att");
423 if(!is_option(&newflags
,SH_PHYSICAL
) && sh_isoption(SH_PHYSICAL
))
424 astconf("PATH_RESOLVE", 0, "metaphysical");
425 if(is_option(&newflags
,SH_PHYSICAL
) && !sh_isoption(SH_PHYSICAL
))
426 astconf("PATH_RESOLVE", 0, "physical");
427 if(is_option(&newflags
,SH_HISTORY2
) && !sh_isoption(SH_HISTORY2
))
429 sh_onstate(SH_HISTORY
);
430 sh_onoption(SH_HISTORY
);
432 if(!is_option(&newflags
,SH_HISTORY2
) && sh_isoption(SH_HISTORY2
))
434 sh_offstate(SH_HISTORY
);
435 sh_offoption(SH_HISTORY
);
438 shp
->options
= newflags
;
442 * returns the value of $-
444 char *sh_argdolminus(void* context
)
446 register Arg_t
*ap
= (Arg_t
*)context
;
447 register const char *cp
=optksh
;
448 register char *flagp
=ap
->flagadr
;
449 while(cp
< &optksh
[NUM_OPTS
])
451 int n
= flagval
[cp
-optksh
];
461 * set up positional parameters
463 static void sh_argset(Arg_t
*ap
,char *argv
[])
465 sh_argfree(ap
->sh
,ap
->dolh
,0);
466 ap
->dolh
= sh_argcreate(argv
);
467 /* link into chain */
468 ap
->dolh
->dolnxt
= ap
->argfor
;
469 ap
->argfor
= ap
->dolh
;
470 ap
->sh
->st
.dolc
= ap
->dolh
->dolnum
-1;
471 ap
->sh
->st
.dolv
= ap
->dolh
->dolval
;
475 * free the argument list if the use count is 1
476 * If count is greater than 1 decrement count and return same blk
477 * Free the argument list if the use count is 1 and return next blk
478 * Delete the blk from the argfor chain
479 * If flag is set, then the block dolh is not freed
481 struct dolnod
*sh_argfree(Shell_t
*shp
, struct dolnod
*blk
,int flag
)
483 register struct dolnod
* argr
=blk
;
484 register struct dolnod
* argblk
;
485 register Arg_t
*ap
= (Arg_t
*)shp
->arg_context
;
488 if((--argblk
->dolrefcnt
)==0)
490 argr
= argblk
->dolnxt
;
491 if(flag
&& argblk
==ap
->dolh
)
492 ap
->dolh
->dolrefcnt
= 1;
495 /* delete from chain */
496 if(ap
->argfor
== argblk
)
497 ap
->argfor
= argblk
->dolnxt
;
500 for(argr
=ap
->argfor
;argr
;argr
=argr
->dolnxt
)
501 if(argr
->dolnxt
==argblk
)
504 return(NIL(struct dolnod
*));
505 argr
->dolnxt
= argblk
->dolnxt
;
506 argr
= argblk
->dolnxt
;
516 * grab space for arglist and copy args
517 * The strings are copied after the argment vector
519 struct dolnod
*sh_argcreate(register char *argv
[])
521 register struct dolnod
*dp
;
522 register char **pp
=argv
, *sp
;
523 register int size
=0,n
;
524 /* count args and number of bytes of arglist */
528 dp
=new_of(struct dolnod
,n
*sizeof(char*)+size
+n
);
529 dp
->dolrefcnt
=1; /* use count */
533 sp
= (char*)dp
+ sizeof(struct dolnod
) + n
*sizeof(char*);
537 sp
= strcopy(sp
, *argv
++) + 1;
544 * used to set new arguments for functions
546 struct dolnod
*sh_argnew(Shell_t
*shp
,char *argi
[], struct dolnod
**savargfor
)
548 register Arg_t
*ap
= (Arg_t
*)shp
->arg_context
;
549 register struct dolnod
*olddolh
= ap
->dolh
;
550 *savargfor
= ap
->argfor
;
558 * reset arguments as they were before function
560 void sh_argreset(Shell_t
*shp
,struct dolnod
*blk
, struct dolnod
*afor
)
562 register Arg_t
*ap
= (Arg_t
*)shp
->arg_context
;
563 while(ap
->argfor
=sh_argfree(shp
,ap
->argfor
,0));
567 shp
->st
.dolc
= ap
->dolh
->dolnum
-1;
568 shp
->st
.dolv
= ap
->dolh
->dolval
;
573 * increase the use count so that an sh_argset will not make it go away
575 struct dolnod
*sh_arguse(Shell_t
* shp
)
577 register struct dolnod
*dh
;
578 register Arg_t
*ap
= (Arg_t
*)shp
->arg_context
;
585 * Print option settings on standard output
586 * if mode is inclusive or of PRINT_*
587 * if <mask> is set, only options with this mask value are displayed
589 void sh_printopts(Shopt_t oflags
,register int mode
, Shopt_t
*mask
)
591 register const Shtable_t
*tp
;
595 if(!(mode
&PRINT_NO_HEADER
))
596 sfputr(sfstdout
,sh_translate(e_heading
),'\n');
605 for(tp
=shtab_options
; value
=tp
->sh_number
; tp
++)
607 if(mask
&& !is_option(mask
,value
&0xff))
610 if(name
[0] == 'n' && name
[1] == 'o' && name
[2] != 't')
612 if(c
<(w
=strlen(name
)))
616 if((w
= ed_window()) < (2*c
))
620 for(tp
=shtab_options
; value
=tp
->sh_number
; tp
++)
622 if(mask
&& !is_option(mask
,value
&0xff))
624 on
= !!is_option(&oflags
,value
);
627 if(name
[0] == 'n' && name
[1] == 'o' && name
[2] != 't')
635 sfprintf(sfstdout
, "%s%s\n", on
? "" : "no", name
);
638 sfprintf(sfstdout
, "%s%-*s", on
? "" : "no", on
? c
: (c
-2), name
);
641 sfputc(sfstdout
,'\n');
645 on_option(&oflags
,SH_VIRAW
);
647 if(!(mode
&(PRINT_ALL
|PRINT_VERBOSE
))) /* only print set options */
650 sfwrite(sfstdout
,"shopt -s",3);
652 sfwrite(sfstdout
,"set --default",13);
654 for(tp
=shtab_options
; value
=tp
->sh_number
; tp
++)
656 if(mask
&& !is_option(mask
,value
&0xff))
658 if(sh_isoption(SH_BASH
))
660 if (!(mode
&PRINT_SHOPT
) != !(value
&SH_BASHOPT
))
663 else if (value
&(SH_BASHEXTRA
|SH_BASHOPT
))
665 on
= !!is_option(&oflags
,value
);
667 if(name
[0] == 'n' && name
[1] == 'o' && name
[2] != 't')
672 if(mode
&PRINT_VERBOSE
)
674 sfputr(sfstdout
,name
,' ');
675 sfnputc(sfstdout
,' ',24-strlen(name
));
676 sfputr(sfstdout
,on
? sh_translate(e_on
) : sh_translate(e_off
),'\n');
678 else if(mode
&PRINT_ALL
) /* print unset options also */
681 sfprintf(sfstdout
, "shopt -%c %s\n",
685 sfprintf(sfstdout
, "set %co %s\n",
689 else if(!(value
&SH_COMMANDLINE
) && is_option(&oflags
,value
&0xff))
690 sfprintf(sfstdout
," %s%s%s",(mode
&PRINT_SHOPT
)?"":"--",on
?"":"no",name
);
692 if(!(mode
&(PRINT_VERBOSE
|PRINT_ALL
)))
693 sfputc(sfstdout
,'\n');
697 * build an argument list
699 char **sh_argbuild(Shell_t
*shp
,int *nargs
, const struct comnod
*comptr
,int flag
)
701 register struct argnod
*argp
;
702 struct argnod
*arghead
=0;
705 register const struct comnod
*ac
= comptr
;
707 /* see if the arguments have already been expanded */
713 else if(!(ac
->comtyp
&COMSCAN
))
715 register struct dolnod
*ap
= (struct dolnod
*)ac
->comarg
;
717 return(ap
->dolval
+ap
->dolbot
);
723 if(ac
->comnamp
== SYSLET
)
728 n
= arg_expand(shp
,argp
,&arghead
,flag
);
732 shp
->xargmin
= *nargs
;
733 shp
->xargmax
= *nargs
+n
;
736 argp
= argp
->argnxt
.ap
;
742 register char **comargn
;
744 register char **comargm
;
746 /* allow room to prepend args */
749 comargn
=(char**)stkalloc(shp
->stk
,(unsigned)(argn
+1)*sizeof(char*));
750 comargm
= comargn
+= argn
;
751 *comargn
= NIL(char*);
754 /* reserve an extra null pointer */
760 struct argnod
*nextarg
= argp
->argchn
.ap
;
762 *--comargn
= argp
->argval
;
763 if(!(argp
->argflag
&ARG_RAW
))
765 if(!(argp
=nextarg
) || (argp
->argflag
&ARG_MAKE
))
767 if((argn
=comargm
-comargn
)>1)
768 strsort(comargn
,argn
,strcoll
);
777 #if _pipe_socketpair && !_socketpair_devfd
778 # define sh_pipe arg_pipe
780 * create a real pipe (not a socket) and print message on failure
782 static int arg_pipe(register int pv
[])
785 if(pipe(fd
)<0 || (pv
[0]=fd
[0])<0 || (pv
[1]=fd
[1])<0)
786 errormsg(SH_DICT
,ERROR_system(1),e_pipe
);
787 pv
[0] = sh_iomovefd(pv
[0]);
788 pv
[1] = sh_iomovefd(pv
[1]);
789 sh
.fdstatus
[pv
[0]] = IONOSEEK
|IOREAD
;
790 sh
.fdstatus
[pv
[1]] = IONOSEEK
|IOWRITE
;
797 struct argnod
*sh_argprocsub(Shell_t
*shp
,struct argnod
*argp
)
799 /* argument of the form <(cmd) or >(cmd) */
800 register struct argnod
*ap
;
801 int monitor
, fd
, pv
[2];
802 int subshell
= shp
->subshell
;
803 ap
= (struct argnod
*)stkseek(shp
->stk
,ARGVAL
);
804 ap
->argflag
|= ARG_MAKE
;
805 ap
->argflag
&= ~ARG_RAW
;
806 sfwrite(shp
->stk
,e_devfdNN
,8);
808 fd
= argp
->argflag
&ARG_RAW
;
809 sfputr(shp
->stk
,fmtbase((long)pv
[fd
],10,0),0);
810 ap
= (struct argnod
*)stkfreeze(shp
->stk
,0);
811 shp
->inpipe
= shp
->outpipe
= 0;
812 if(monitor
= (sh_isstate(SH_MONITOR
)!=0))
813 sh_offstate(SH_MONITOR
);
818 sh_exec((Shnode_t
*)argp
->argchn
.ap
,(int)sh_isstate(SH_ERREXIT
));
823 sh_exec((Shnode_t
*)argp
->argchn
.ap
,(int)sh_isstate(SH_ERREXIT
));
825 shp
->subshell
= subshell
;
827 sh_onstate(SH_MONITOR
);
829 sh_iosave(shp
,-pv
[fd
], shp
->topfd
, (char*)0);
833 /* Argument expansion */
834 static int arg_expand(Shell_t
*shp
,register struct argnod
*argp
, struct argnod
**argchain
,int flag
)
836 register int count
= 0;
837 argp
->argflag
&= ~ARG_MAKE
;
839 if(*argp
->argval
==0 && (argp
->argflag
&ARG_EXP
))
842 ap
= sh_argprocsub(shp
,argp
);
843 ap
->argchn
.ap
= *argchain
;
848 #endif /* SHOPT_DEVFD */
849 if(!(argp
->argflag
&ARG_RAW
))
853 sh_stats(STAT_ARGEXPAND
);
854 if(flag
&ARG_OPTIMIZE
)
856 if(ap
=argp
->argchn
.ap
)
858 sh_stats(STAT_ARGHITS
);
860 ap
->argchn
.ap
= *argchain
;
861 ap
->argflag
|= ARG_RAW
;
862 ap
->argflag
&= ~ARG_EXP
;
866 #endif /* SHOPT_OPTIMIZE */
867 count
= sh_macexpand(shp
,argp
,argchain
,flag
);
871 argp
->argchn
.ap
= *argchain
;
873 argp
->argflag
|= ARG_MAKE
;