-
-
Notifications
You must be signed in to change notification settings - Fork 274
Closed
Description
Existing code:
Lines 413 to 419 in 627ae4b
| } else if (c == sudo_term_erase) { | |
| if (cp > buf) { | |
| ignore_result(write(fd, "\b \b", 3)); | |
| cp--; | |
| left++; | |
| } | |
| continue; |
If the first key pressed is BACKSPACE, the
left variable is decreased by 1, thepointer
cp == buf and the reading of the next key is performed.I think in this case, the
left variable should be incremented by 1,While if there are inserted values in the
buf variable, the left variable should beincremented by
2.That is, the BACKSPACE handling should look like this:
} else if (c == sudo_term_erase) {
if (cp > buf) {
ignore_result(write(fd, "\b \b", 3));
cp--;
left++;
}
left++;
continue;
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels