Changeset 1198 for trunk/src/kash/miscbltin.c
- Timestamp:
- Oct 6, 2007, 11:19:19 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/miscbltin.c
r809 r1198 125 125 status = 0; 126 126 startword = 2; 127 STARTSTACKSTR(p );127 STARTSTACKSTR(psh, p); 128 128 for (;;) { 129 129 if (read(0, &c, 1) != 1) { … … 139 139 } 140 140 if (c != '\n') 141 STPUTC( c, p);141 STPUTC(psh, c, p); 142 142 continue; 143 143 } … … 153 153 /* Ignore leading IFS whitespace */ 154 154 if (saveall) 155 STPUTC( c, p);155 STPUTC(psh, c, p); 156 156 continue; 157 157 } … … 160 160 startword = 2; 161 161 if (saveall) 162 STPUTC( c, p);162 STPUTC(psh, c, p); 163 163 continue; 164 164 } … … 171 171 /* Not just a spare terminator */ 172 172 saveall++; 173 STPUTC( c, p);173 STPUTC(psh, c, p); 174 174 continue; 175 175 } … … 181 181 /* Last variable needs all IFS chars */ 182 182 saveall++; 183 STPUTC( c, p);183 STPUTC(psh, c, p); 184 184 continue; 185 185 } 186 186 187 STACKSTRNUL(p );188 setvar(*ap, stackblock( ), 0);187 STACKSTRNUL(psh, p); 188 setvar(*ap, stackblock(psh), 0); 189 189 ap++; 190 STARTSTACKSTR(p );191 } 192 STACKSTRNUL(p );190 STARTSTACKSTR(psh, p); 191 } 192 STACKSTRNUL(psh, p); 193 193 194 194 /* Remove trailing IFS chars */ 195 for (; stackblock( ) <= --p; *p = 0) {195 for (; stackblock(psh) <= --p; *p = 0) { 196 196 if (!strchr(ifs, *p)) 197 197 break; … … 203 203 break; 204 204 } 205 setvar(*ap, stackblock( ), 0);205 setvar(*ap, stackblock(psh), 0); 206 206 207 207 /* Set any remaining args to "" */
Note:
See TracChangeset
for help on using the changeset viewer.