Index: trunk/src/kash/exec.c
===================================================================
--- trunk/src/kash/exec.c	(revision 1199)
+++ trunk/src/kash/exec.c	(revision 1200)
@@ -154,5 +154,5 @@
 	} else {
 		e = ENOENT;
-		while ((cmdname = padvance(&path, argv[0])) != NULL) {
+		while ((cmdname = padvance(psh, &path, argv[0])) != NULL) {
 			if (--idx < 0 && pathopt == NULL) {
 				tryexec(cmdname, argv, envp, vforked, has_ext);
@@ -310,5 +310,5 @@
 	while (*ap2++ = *ap++);
 	TRACE((psh, "hash bang '%s'\n", new[0]));
-	shellexec(new, envp, pathval(), 0, 0);
+	shellexec(psh, new, envp, pathval(), 0, 0);
 	/* NOTREACHED */
 }
@@ -458,5 +458,5 @@
 		     || (cmdp->cmdtype == CMDBUILTIN && builtinloc >= 0)))
 			delete_cmd_entry();
-		find_command(name, &entry, DO_ERR, pathval());
+		find_command(psh, name, &entry, DO_ERR, pathval());
 		if (verbose) {
 			if (entry.cmdtype != CMDUNKNOWN) {	/* if no error msg */
@@ -484,5 +484,5 @@
 		path = pathval();
 		do {
-			name = padvance(&path, cmdp->cmdname);
+			name = padvance(psh, &path, cmdp->cmdname);
 			stunalloc(psh, name);
 		} while (--idx >= 0);
@@ -607,5 +607,5 @@
 	/* If %builtin not in path, check for builtin next */
 	if ((act & DO_ALTPATH ? !(act & DO_ALTBLTIN) : builtinloc < 0) &&
-	    (bltin = find_builtin(name)) != 0)
+	    (bltin = find_builtin(psh, name)) != 0)
 		goto builtin_success;
 
@@ -622,10 +622,10 @@
 	idx = -1;
 loop:
-	while ((fullname = padvance(&path, name)) != NULL) {
+	while ((fullname = padvance(psh, &path, name)) != NULL) {
 		stunalloc(psh, fullname);
 		idx++;
 		if (pathopt) {
 			if (prefix("builtin", pathopt)) {
-				if ((bltin = find_builtin(name)) == 0)
+				if ((bltin = find_builtin(psh, name)) == 0)
 					goto loop;
 				goto builtin_success;
@@ -892,13 +892,13 @@
 
 #ifdef mkinit
-MKINIT void deletefuncs(void);
-MKINIT void hash_special_builtins(void);
+MKINIT void deletefuncs(struct shinstance *);
+MKINIT void hash_special_builtins(struct shinstance *);
 
 INIT {
-	hash_special_builtins();
+	hash_special_builtins(psh);
 }
 
 SHELLPROC {
-	deletefuncs();
+	deletefuncs(psh);
 }
 #endif
@@ -1043,5 +1043,5 @@
 	entry.cmdtype = CMDFUNCTION;
 	entry.u.func = copyfunc(func);
-	addcmdentry(name, &entry);
+	addcmdentry(psh, name, &entry);
 	INTON;
 }
@@ -1126,5 +1126,5 @@
 		} else {
 			/* Finally use brute force */
-			find_command(arg, &entry, DO_ABS, pathval());
+			find_command(psh, arg, &entry, DO_ABS, pathval());
 		}
 
@@ -1136,5 +1136,5 @@
 				int j = entry.u.index;
 				do {
-					name = padvance(&path, arg);
+					name = padvance(psh, &path, arg);
 					stunalloc(psh, name);
 				} while (--j >= 0);
Index: trunk/src/kash/expand.c
===================================================================
--- trunk/src/kash/expand.c	(revision 1199)
+++ trunk/src/kash/expand.c	(revision 1200)
@@ -439,5 +439,5 @@
 	psh->herefd = -1;
 	p = grabstackstr(psh, dest);
-	evalbackcmd(cmd, &in);
+	evalbackcmd(psh, cmd, &in);
 	ungrabstackstr(psh, p, dest);
 	ifsfirst = saveifs;
Index: trunk/src/kash/generated/init.c
===================================================================
--- trunk/src/kash/generated/init.c	(revision 1199)
+++ trunk/src/kash/generated/init.c	(revision 1200)
@@ -122,6 +122,6 @@
 extern int loopnest;		/* current loop nesting level */
 
-extern void deletefuncs(void);
-extern void hash_special_builtins(void);
+extern void deletefuncs(struct shinstance *);
+extern void hash_special_builtins(struct shinstance *);
 
 struct strpush {
@@ -266,5 +266,5 @@
       /* from exec.c: */
       {
-	      deletefuncs();
+	      deletefuncs(psh);
       }
 
Index: trunk/src/kash/histedit.c
===================================================================
--- trunk/src/kash/histedit.c	(revision 1199)
+++ trunk/src/kash/histedit.c	(revision 1200)
@@ -418,5 +418,5 @@
 				}
 
-				evalstring(strcpy(stalloc(psh, strlen(s) + 1), s), 0);
+				evalstring(psh, strcpy(stalloc(psh, strlen(s) + 1), s), 0);
 				if (displayhist && hist) {
 					/*
@@ -442,5 +442,5 @@
 		editcmd = stalloc(psh, strlen(editor) + strlen(editfile) + 2);
 		sprintf(editcmd, "%s %s", editor, editfile);
-		evalstring(editcmd, 0);	/* XXX - should use no JC command */
+		evalstring(psh, editcmd, 0);	/* XXX - should use no JC command */
 		INTON;
 		readcmdfile(editfile);	/* XXX - should read back - quick tst */
Index: trunk/src/kash/trap.c
===================================================================
--- trunk/src/kash/trap.c	(revision 1199)
+++ trunk/src/kash/trap.c	(revision 1200)
@@ -408,5 +408,5 @@
 		gotsig[i - 1] = 0;
 		savestatus=exitstatus;
-		evalstring(trap[i], 0);
+		evalstring(psh, trap[i], 0);
 		exitstatus=savestatus;
 	}
@@ -457,5 +457,5 @@
 	if ((p = trap[0]) != NULL && *p != '\0') {
 		trap[0] = NULL;
-		evalstring(p, 0);
+		evalstring(psh, p, 0);
 	}
 l1:   handler = &loc2;			/* probably unnecessary */
Index: trunk/src/kash/var.c
===================================================================
--- trunk/src/kash/var.c	(revision 1199)
+++ trunk/src/kash/var.c	(revision 1200)
@@ -832,7 +832,7 @@
 	for (ap = argptr; *ap ; ap++) {
 		if (flg_func)
-			ret |= unsetfunc(*ap);
+			ret |= unsetfunc(psh, *ap);
 		if (flg_var)
-			ret |= unsetvar(*ap, flg_var == 'e');
+			ret |= unsetvar(psh, *ap, flg_var == 'e');
 	}
 	return ret;
