apt/apt-0.5.15lorg2-alt-apt-shell-quit_by_eof.patch
Slava Semushin 403aa68686 quit_by_eof.patch: print newline before exit.
Be more accurate during exit by Ctrl+D.
Thanks to Ivan A. Melnikov <iv@altlinux> for feedback.
2009-01-09 23:52:48 +06:00

27 lines
645 B
Diff

https://bugzilla.altlinux.org/show_bug.cgi?id=18343
--- apt/cmdline/apt-shell.cc
+++ apt/cmdline/apt-shell.cc
@@ -4477,10 +4477,18 @@ int main(int argc,const char *argv[])
}
line = readline(_config->Find("APT::Shell::Prompt", "apt> ").c_str());
- if (!line || !*line) {
- free(line);
- continue;
+ if (!line) {
+ c1out << endl;
+ // exit from shell by EOF
+ _config->Set("quit", "true");
+ continue;
+ }
+
+ if (!*line) {
+ free(line);
+ continue;
}
+
add_history(line);
largc = 1; // CommandLine.Parse() ignores the first option.