Changeset 1198 for trunk/src/kash/eval.c
- Timestamp:
- Oct 6, 2007, 11:19:19 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/eval.c
r884 r1198 125 125 126 126 RESET { 127 evalskip = 0;128 loopnest = 0;129 funcnest = 0;127 psh->evalskip = 0; 128 psh->loopnest = 0; 129 psh->funcnest = 0; 130 130 } 131 131 132 132 SHELLPROC { 133 exitstatus = 0;133 psh->exitstatus = 0; 134 134 } 135 135 #endif … … 176 176 p = argv[1]; 177 177 if (argc > 2) { 178 STARTSTACKSTR( concat);178 STARTSTACKSTR(psh, concat); 179 179 ap = argv + 2; 180 180 for (;;) { 181 181 while (*p) 182 STPUTC( *p++, concat);182 STPUTC(psh, *p++, concat); 183 183 if ((p = *ap++) == NULL) 184 184 break; 185 STPUTC( ' ', concat);185 STPUTC(psh, ' ', concat); 186 186 } 187 STPUTC( '\0', concat);188 p = grabstackstr( concat);187 STPUTC(psh, '\0', concat); 188 p = grabstackstr(psh, concat); 189 189 } 190 190 evalstring(psh, p, EV_TESTED); … … 594 594 shfile_close(&psh->fdtab, pip[1]); 595 595 } 596 psh->eflag= 0;596 eflag(psh) = 0; 597 597 evaltree(psh, n, EV_EXIT); 598 598 /* NOTREACHED */ … … 765 765 *argv = NULL; 766 766 lastarg = NULL; 767 if ( psh->iflag&& psh->funcnest == 0 && argc > 0)767 if (iflag(psh) && psh->funcnest == 0 && argc > 0) 768 768 lastarg = argv[-1]; 769 769 argv -= argc; 770 770 771 771 /* Print the command if xflag is set. */ 772 if ( psh->xflag) {772 if (xflag(psh)) { 773 773 char sep = 0; 774 774 out2str(psh, ps4val(psh)); … … 1062 1062 if (flags == EV_BACKCMD) { 1063 1063 backcmd->buf = psh->memout.buf; 1064 backcmd->nleft = psh->memout.nextc - psh->memout.buf;1064 backcmd->nleft = (int)(psh->memout.nextc - psh->memout.buf); 1065 1065 psh->memout.buf = NULL; 1066 1066 } … … 1101 1101 popstackmark(psh, &smark); 1102 1102 1103 if ( psh->eflag&& psh->exitstatus && !(flags & EV_TESTED))1103 if (eflag(psh) && psh->exitstatus && !(flags & EV_TESTED)) 1104 1104 exitshell(psh, psh->exitstatus); 1105 1105 } … … 1160 1160 breakcmd(shinstance *psh, int argc, char **argv) 1161 1161 { 1162 int n = argc > 1 ? number( argv[1]) : 1;1162 int n = argc > 1 ? number(psh, argv[1]) : 1; 1163 1163 1164 1164 if (n > psh->loopnest) … … 1179 1179 returncmd(shinstance *psh, int argc, char **argv) 1180 1180 { 1181 int ret = argc > 1 ? number( argv[1]) : psh->exitstatus;1181 int ret = argc > 1 ? number(psh, argv[1]) : psh->exitstatus; 1182 1182 1183 1183 if (psh->funcnest) { … … 1215 1215 struct strlist *sp; 1216 1216 1217 psh->iflag= 0; /* exit on error */1218 psh->mflag= 0;1217 iflag(psh) = 0; /* exit on error */ 1218 mflag(psh) = 0; 1219 1219 optschanged(psh); 1220 1220 for (sp = psh->cmdenviron; sp; sp = sp->next) … … 1230 1230 static clock_t tpm = 0; 1231 1231 clock_t mins; 1232 int i;1232 size_t i; 1233 1233 1234 1234 if (!tpm)
Note:
See TracChangeset
for help on using the changeset viewer.