Changeset 2642 in kBuild
- Timestamp:
- Sep 9, 2012 2:03:12 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/exec.c
r2298 r2642 240 240 */ 241 241 242 #define NEWARGS 5242 #define NEWARGS 16 243 243 244 244 STATIC void … … 276 276 *ap++ = grabstackstr(psh, outp); 277 277 } 278 if (ap == newargs + 1) { /* if no args, maybe no exec is needed */ 279 p = newargs[0]; 280 for (;;) { 281 if (equal(p, "sh") || equal(p, "ash")) { 282 TRACE((psh, "hash bang self\n")); 283 return; 284 } 285 while (*p != '/') { 286 if (*p == '\0') 287 goto break2; 288 p++; 289 } 290 p++; 291 } 292 break2:; 293 } 278 279 /* if no args, maybe shell and no exec is needed. */ 280 if (ap == newargs + 1) { 281 p = strrchr(newargs[0], '/'); 282 if (!p) 283 p = newargs[0]; 284 if (equal(p, "kmk_ash") || equal(p, "kmk_sh") || equal(p, "kash") || equal(p, "sh")) { 285 TRACE((psh, "hash bang self\n")); 286 return; 287 } 288 } 289 294 290 i = (char *)ap - (char *)newargs; /* size in bytes */ 295 291 if (i == 0)
Note:
See TracChangeset
for help on using the changeset viewer.