浏览代码
Exit prompt on ^D at empty prompt
master
Arun Prakash Jana
5 年前
找不到此签名对应的密钥
GPG 密钥 ID: A75979F35C080412
共有
1 个文件被更改,包括
6 次插入 和
2 次删除
-
src/nnn.c
|
|
@@ -2412,8 +2412,12 @@ static char *xreadline(const char *prefill, const char *prompt) |
|
|
|
case CONTROL('D'): |
|
|
|
if (pos < len) |
|
|
|
++pos; |
|
|
|
else |
|
|
|
continue; // fallthrough |
|
|
|
else if (!(pos || len)) { /* Exit on ^D at empty prompt */ |
|
|
|
len = 0; |
|
|
|
goto END; |
|
|
|
} else |
|
|
|
continue; |
|
|
|
// fallthrough |
|
|
|
case 127: // fallthrough |
|
|
|
case '\b': /* rhel25 sends '\b' for backspace */ |
|
|
|
if (pos > 0) { |
|
|
|