die("who are you?\n");
}
- sh = (pw->pw_shell[0]) ? pw->pw_shell : shell;
+ if (!(sh = getenv("SHELL"))) {
+ sh = (pw->pw_shell[0]) ? pw->pw_shell : shell;
+ }
+
if(opt_cmd)
prog = opt_cmd[0];
else if(utmp)
signal(SIGALRM, SIG_DFL);
execvp(prog, args);
- exit(EXIT_FAILURE);
+ _exit(EXIT_FAILURE);
}
void
unicodep = ascii = *c;
} else {
utf8decode(c, &unicodep, UTF_SIZ);
- width = wcwidth(unicodep);
+ if ((width = wcwidth(unicodep)) == -1) {
+ c = "\357\277\275"; /* UTF_INVALID */
+ width = 1;
+ }
control = ISCONTROLC1(unicodep);
ascii = unicodep;
}