@@ -720,7 +720,7 @@ static char* get_lastarg(Namval_t* np, Namfun_t *fp)
char *cp;
int pid;
if(sh_isstate(SH_INIT) && (cp=shp->lastarg) && *cp=='*' && (pid=strtol(cp+1,&cp,10)) && *cp=='*')
- nv_putval(np,(pid==shp->gd->ppid?cp+1:0),0);
+ nv_putval(np,cp+1,0);
return(shp->lastarg);
}
@@ -298,7 +298,7 @@ int sh_main(int ac, char *av[], Shinit_f userinit)
*/
if (shp->st.repl_index > 0)
av[shp->st.repl_index] = shp->st.repl_arg;
- if(((type = sh_type(cp = av[0])) & SH_TYPE_SH) && (!(name = nv_getval(L_ARGNOD)) || !((type = sh_type(cp = name)) & SH_TYPE_SH)))
+ if(((type = sh_type(cp = av[0])) & SH_TYPE_SH) && (name = nv_getval(L_ARGNOD)) && (!((type = sh_type(cp = name)) & SH_TYPE_SH)))
{
av[0] = (type & SH_TYPE_LOGIN) ? cp : path_basename(cp);
/* exec to change $0 for ps */