diff options
author | Guillem Jover <guillem@debian.org> | 2011-11-27 23:53:15 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2011-12-08 22:54:14 +0100 |
commit | e5dbbbb6770c7b432bcfd35dae8d2ff86bd03ed6 (patch) | |
tree | ec336bb674b27baff182cf8078533d5faabc7d8d | |
parent | 3c3a1adfa0a1a4217587ac06b1bad799d1bbbb2d (diff) | |
download | dpkg-e5dbbbb6770c7b432bcfd35dae8d2ff86bd03ed6.tar.gz |
dpkg: Change --print-foreign-architectures to print an entry per line
Printing just a line with space separated entries makes both the code
to print and to parse slightly more complicated. The worst part comes
from parsing as the standard stream input operations require delimited
buffers, and as such if those buffers would not be enough truncation
would happen.
-rw-r--r-- | man/dpkg.1 | 4 | ||||
-rw-r--r-- | src/enquiry.c | 6 |
2 files changed, 4 insertions, 6 deletions
diff --git a/man/dpkg.1 b/man/dpkg.1 index 9f11a6ef9..a01ae42e8 100644 --- a/man/dpkg.1 +++ b/man/dpkg.1 @@ -1,4 +1,4 @@ -.TH dpkg 1 "2011-08-14" "Debian Project" "dpkg suite" +.TH dpkg 1 "2011-11-27" "Debian Project" "dpkg suite" .SH NAME dpkg \- package manager for Debian . @@ -236,7 +236,7 @@ reason still haven't been installed. Print architecture of packages \fBdpkg\fP installs (for example, "i386"). .TP .B \-\-print\-foreign\-architectures -Print a space-separated list of the extra architectures \fBdpkg\fP is +Print a newline-separated list of the extra architectures \fBdpkg\fP is configured to allow packages to be installed for. .TP .B \-\-compare\-versions \fIver1 op ver2\fP diff --git a/src/enquiry.c b/src/enquiry.c index 2b45db3c3..1d7326f40 100644 --- a/src/enquiry.c +++ b/src/enquiry.c @@ -480,7 +480,6 @@ int print_foreign_arches(const char *const *argv) { struct dpkg_arch *arch; - const char *sep = ""; if (*argv) badusage(_("--%s takes no arguments"), cipaction->olong); @@ -488,10 +487,9 @@ print_foreign_arches(const char *const *argv) for (arch = dpkg_arch_get_list(); arch; arch = arch->next) { if (arch->type != arch_foreign) continue; - printf("%s%s", sep, arch->name); - sep = " "; + + printf("%s\n", arch->name); } - printf("\n"); m_output(stdout, _("<standard output>")); |