static int changed;
/* tgetpass() needs to know the erase and kill chars for cbreak mode. */
+__dso_public int sudo_term_eof;
__dso_public int sudo_term_erase;
__dso_public int sudo_term_kill;
term.c_cc[VSTATUS] = _POSIX_VDISABLE;
#endif
if (tcsetattr_nobg(fd, TCSASOFT|TCSADRAIN, &term) == 0) {
+ sudo_term_eof = term.c_cc[VEOF];
sudo_term_erase = term.c_cc[VERASE];
sudo_term_kill = term.c_cc[VKILL];
changed = 1;
debug_return_str_masked(pass);
}
-extern int sudo_term_erase, sudo_term_kill;
+extern int sudo_term_eof, sudo_term_erase, sudo_term_kill;
static char *
getln(int fd, char *buf, size_t bufsiz, int feedback)
if (nr != 1 || c == '\n' || c == '\r')
break;
if (feedback) {
- if (c == sudo_term_kill) {
+ if (c == sudo_term_eof) {
+ nr = 0;
+ break;
+ } else if (c == sudo_term_kill) {
while (cp > buf) {
if (write(fd, "\b \b", 3) == -1)
break;