Changeset 1200 in kBuild for trunk/src/kash
- Timestamp:
- Oct 6, 2007 10:11:34 PM (17 years ago)
- Location:
- trunk/src/kash
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/exec.c
r1199 r1200 154 154 } else { 155 155 e = ENOENT; 156 while ((cmdname = padvance( &path, argv[0])) != NULL) {156 while ((cmdname = padvance(psh, &path, argv[0])) != NULL) { 157 157 if (--idx < 0 && pathopt == NULL) { 158 158 tryexec(cmdname, argv, envp, vforked, has_ext); … … 310 310 while (*ap2++ = *ap++); 311 311 TRACE((psh, "hash bang '%s'\n", new[0])); 312 shellexec( new, envp, pathval(), 0, 0);312 shellexec(psh, new, envp, pathval(), 0, 0); 313 313 /* NOTREACHED */ 314 314 } … … 458 458 || (cmdp->cmdtype == CMDBUILTIN && builtinloc >= 0))) 459 459 delete_cmd_entry(); 460 find_command( name, &entry, DO_ERR, pathval());460 find_command(psh, name, &entry, DO_ERR, pathval()); 461 461 if (verbose) { 462 462 if (entry.cmdtype != CMDUNKNOWN) { /* if no error msg */ … … 484 484 path = pathval(); 485 485 do { 486 name = padvance( &path, cmdp->cmdname);486 name = padvance(psh, &path, cmdp->cmdname); 487 487 stunalloc(psh, name); 488 488 } while (--idx >= 0); … … 607 607 /* If %builtin not in path, check for builtin next */ 608 608 if ((act & DO_ALTPATH ? !(act & DO_ALTBLTIN) : builtinloc < 0) && 609 (bltin = find_builtin( name)) != 0)609 (bltin = find_builtin(psh, name)) != 0) 610 610 goto builtin_success; 611 611 … … 622 622 idx = -1; 623 623 loop: 624 while ((fullname = padvance( &path, name)) != NULL) {624 while ((fullname = padvance(psh, &path, name)) != NULL) { 625 625 stunalloc(psh, fullname); 626 626 idx++; 627 627 if (pathopt) { 628 628 if (prefix("builtin", pathopt)) { 629 if ((bltin = find_builtin( name)) == 0)629 if ((bltin = find_builtin(psh, name)) == 0) 630 630 goto loop; 631 631 goto builtin_success; … … 892 892 893 893 #ifdef mkinit 894 MKINIT void deletefuncs( void);895 MKINIT void hash_special_builtins( void);894 MKINIT void deletefuncs(struct shinstance *); 895 MKINIT void hash_special_builtins(struct shinstance *); 896 896 897 897 INIT { 898 hash_special_builtins( );898 hash_special_builtins(psh); 899 899 } 900 900 901 901 SHELLPROC { 902 deletefuncs( );902 deletefuncs(psh); 903 903 } 904 904 #endif … … 1043 1043 entry.cmdtype = CMDFUNCTION; 1044 1044 entry.u.func = copyfunc(func); 1045 addcmdentry( name, &entry);1045 addcmdentry(psh, name, &entry); 1046 1046 INTON; 1047 1047 } … … 1126 1126 } else { 1127 1127 /* Finally use brute force */ 1128 find_command( arg, &entry, DO_ABS, pathval());1128 find_command(psh, arg, &entry, DO_ABS, pathval()); 1129 1129 } 1130 1130 … … 1136 1136 int j = entry.u.index; 1137 1137 do { 1138 name = padvance( &path, arg);1138 name = padvance(psh, &path, arg); 1139 1139 stunalloc(psh, name); 1140 1140 } while (--j >= 0); -
trunk/src/kash/expand.c
r1199 r1200 439 439 psh->herefd = -1; 440 440 p = grabstackstr(psh, dest); 441 evalbackcmd( cmd, &in);441 evalbackcmd(psh, cmd, &in); 442 442 ungrabstackstr(psh, p, dest); 443 443 ifsfirst = saveifs; -
trunk/src/kash/generated/init.c
r1199 r1200 122 122 extern int loopnest; /* current loop nesting level */ 123 123 124 extern void deletefuncs( void);125 extern void hash_special_builtins( void);124 extern void deletefuncs(struct shinstance *); 125 extern void hash_special_builtins(struct shinstance *); 126 126 127 127 struct strpush { … … 266 266 /* from exec.c: */ 267 267 { 268 deletefuncs( );268 deletefuncs(psh); 269 269 } 270 270 -
trunk/src/kash/histedit.c
r1199 r1200 418 418 } 419 419 420 evalstring( strcpy(stalloc(psh, strlen(s) + 1), s), 0);420 evalstring(psh, strcpy(stalloc(psh, strlen(s) + 1), s), 0); 421 421 if (displayhist && hist) { 422 422 /* … … 442 442 editcmd = stalloc(psh, strlen(editor) + strlen(editfile) + 2); 443 443 sprintf(editcmd, "%s %s", editor, editfile); 444 evalstring( editcmd, 0); /* XXX - should use no JC command */444 evalstring(psh, editcmd, 0); /* XXX - should use no JC command */ 445 445 INTON; 446 446 readcmdfile(editfile); /* XXX - should read back - quick tst */ -
trunk/src/kash/trap.c
r1199 r1200 408 408 gotsig[i - 1] = 0; 409 409 savestatus=exitstatus; 410 evalstring( trap[i], 0);410 evalstring(psh, trap[i], 0); 411 411 exitstatus=savestatus; 412 412 } … … 457 457 if ((p = trap[0]) != NULL && *p != '\0') { 458 458 trap[0] = NULL; 459 evalstring(p , 0);459 evalstring(psh, p, 0); 460 460 } 461 461 l1: handler = &loc2; /* probably unnecessary */ -
trunk/src/kash/var.c
r1199 r1200 832 832 for (ap = argptr; *ap ; ap++) { 833 833 if (flg_func) 834 ret |= unsetfunc( *ap);834 ret |= unsetfunc(psh, *ap); 835 835 if (flg_var) 836 ret |= unsetvar( *ap, flg_var == 'e');836 ret |= unsetvar(psh, *ap, flg_var == 'e'); 837 837 } 838 838 return ret;
Note:
See TracChangeset
for help on using the changeset viewer.