apt-shell: quit from shell by Ctrl+D (#18343)
This commit is contained in:
parent
1c7245aad0
commit
7956d444db
28
apt-0.5.15lorg2-alt-apt-shell_quit_by_ctrld.patch
Normal file
28
apt-0.5.15lorg2-alt-apt-shell_quit_by_ctrld.patch
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
https://bugzilla.altlinux.org/show_bug.cgi?id=18343
|
||||
|
||||
diff --git a/apt/cmdline/apt-shell.cc b/apt/cmdline/apt-shell.cc
|
||||
index 6d1f767..3aadbd5 100644
|
||||
--- a/apt/cmdline/apt-shell.cc
|
||||
+++ b/apt/cmdline/apt-shell.cc
|
||||
@@ -4477,10 +4477,17 @@ 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) {
|
||||
+ // exit from shell by Ctrl-D
|
||||
+ _config->Set("quit", "true");
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (!*line) {
|
||||
+ free(line);
|
||||
+ continue;
|
||||
}
|
||||
+
|
||||
add_history(line);
|
||||
|
||||
largc = 1; // CommandLine.Parse() ignores the first option.
|
2
apt.spec
2
apt.spec
@ -69,6 +69,7 @@ Patch57: apt-0.5.15lorg2-alt-genpkglist-no-fileflags.patch
|
||||
Patch58: apt-0.5.15lorg2-lorg-cache-limit.patch
|
||||
Patch59: apt-0.5.15lorg2-alt-gcc4.3.patch
|
||||
Patch60: apt-0.5.15lorg2-alt-apt-shell_list_completion.patch
|
||||
Patch61: apt-0.5.15lorg2-alt-apt-shell_quit_by_ctrld.patch
|
||||
|
||||
# Normally not applied, but useful.
|
||||
Patch101: apt-0.5.4cnc9-alt-getsrc-debug.patch
|
||||
@ -269,6 +270,7 @@ This package contains method 'rsync' for APT.
|
||||
%patch58 -p1
|
||||
%patch59 -p1
|
||||
%patch60 -p2
|
||||
%patch61 -p2
|
||||
|
||||
find -type f -name \*.orig -delete
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user