Changeset 1201 in kBuild for trunk/src/kash/expand.c
- Timestamp:
- Oct 6, 2007 11:57:35 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/expand.c
r1200 r1201 122 122 123 123 void 124 expandhere( union node *arg, int fd)124 expandhere(shinstance *psh, union node *arg, int fd) 125 125 { 126 126 psh->herefd = fd; 127 expandarg( arg, (struct arglist *)NULL, 0);128 xwrite(psh, fd, stackblock(psh), expdest - stackblock(psh));127 expandarg(psh, arg, (struct arglist *)NULL, 0); 128 xwrite(psh, fd, stackblock(psh), psh->expdest - stackblock(psh)); 129 129 } 130 130 … … 164 164 } else { 165 165 if (flag & EXP_REDIR) /*XXX - for now, just remove escapes */ 166 rmescapes(p );166 rmescapes(psh, p); 167 167 sp = (struct strlist *)stalloc(psh, sizeof (struct strlist)); 168 168 sp->text = p; … … 231 231 break; 232 232 case CTLENDARI: 233 expari( flag);233 expari(psh, flag); 234 234 break; 235 235 case ':': … … 398 398 removerecordregions(begoff); 399 399 if (quotes) 400 rmescapes(p +2);400 rmescapes(psh, p+2); 401 401 result = arith(p+2); 402 402 fmtstr(p, 12, "%d", result); … … 522 522 case VSQUESTION: 523 523 if (*p != CTLENDVAR) { 524 outfmt(& errout, "%s\n", startp);524 outfmt(&psh->errout, "%s\n", startp); 525 525 error(psh, (char *)NULL); 526 526 } … … 534 534 c = *loc; 535 535 *loc = '\0'; 536 if (patmatch( str, startp, varflags & VSQUOTE))536 if (patmatch(psh, str, startp, varflags & VSQUOTE)) 537 537 goto recordleft; 538 538 *loc = c; … … 546 546 c = *loc; 547 547 *loc = '\0'; 548 if (patmatch( str, startp, varflags & VSQUOTE))548 if (patmatch(psh, str, startp, varflags & VSQUOTE)) 549 549 goto recordleft; 550 550 *loc = c; … … 563 563 case VSTRIMRIGHT: 564 564 for (loc = str - 1; loc >= startp;) { 565 if (patmatch( str, loc, varflags & VSQUOTE))565 if (patmatch(psh, str, loc, varflags & VSQUOTE)) 566 566 goto recordright; 567 567 loc--; … … 579 579 case VSTRIMRIGHTMAX: 580 580 for (loc = startp; loc < str - 1; loc++) { 581 if (patmatch( str, loc, varflags & VSQUOTE))581 if (patmatch(psh, str, loc, varflags & VSQUOTE)) 582 582 goto recordright; 583 583 if ((varflags & VSQUOTE) && *loc == CTLESC) … … 1111 1111 nometa: 1112 1112 *exparg.lastp = str; 1113 rmescapes( str->text);1113 rmescapes(psh, str->text); 1114 1114 exparg.lastp = &str->next; 1115 1115 } else { … … 1235 1235 if (dp->d_name[0] == '.' && ! matchdot) 1236 1236 continue; 1237 if (patmatch( start, dp->d_name, 0)) {1237 if (patmatch(psh, start, dp->d_name, 0)) { 1238 1238 if (atend) { 1239 1239 scopy(dp->d_name, enddir); … … 1516 1516 STPUTC(psh, '\0', expdest); 1517 1517 p = grabstackstr(psh, expdest); 1518 result = patmatch(p , val, 0);1518 result = patmatch(psh, p, val, 0); 1519 1519 popstackmark(psh, &smark); 1520 1520 return result; … … 1551 1551 1552 1552 int 1553 wordexpcmd( int argc, char **argv)1553 wordexpcmd(shinstance *psh, int argc, char **argv) 1554 1554 { 1555 1555 size_t len;
Note:
See TracChangeset
for help on using the changeset viewer.