From f28eef6df2a9fd2befedacf8ccd6248e5b3618db Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 11 Oct 2013 22:05:38 +0200 Subject: add missing _() around the new "Progress" string --- apt-pkg/deb/dpkgpm.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index b4d812d26..c29d21574 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -901,7 +901,7 @@ void pkgDPkgPM::SendTerminalProgress(float percentage) return; std::string progress_str; - strprintf(progress_str, "Progress: [%3i%%]", (int)percentage); + strprintf(progress_str, _("Progress: [%3i%%]"), (int)percentage); if (d->fancy_progress_output) { int row = d->nr_terminal_rows; -- cgit v1.2.3 From 7794a6880e74446075d9cae19525829ada5b0d91 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 13 Oct 2013 19:33:09 +0200 Subject: fix progress-segfault in case of dpkg errors/prompts Errors and conffile prompts have a fourth information piece, which the "old" code access which isn't provided by the "new" one. This isn't checking if the messages are really well-formed, so it could still segfault on misformed messages, but this code needs more work anyway, so one step at a time. Closes: 726047 --- apt-pkg/deb/dpkgpm.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index c29d21574..1fbeabbdc 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -546,8 +546,8 @@ void pkgDPkgPM::ProcessDpkgStatusLine(int OutStatusFd, char *line) // A dpkg error message may contain additional ":" (like // "failed in buffer_write(fd) (10, ret=-1): backend dpkg-deb ..." // so we need to ensure to not split too much - std::vector list = StringSplit(line, ": ", 3); - if(list.size() != 3) + std::vector list = StringSplit(line, ": ", 4); + if(list.size() < 3) { if (Debug == true) std::clog << "ignoring line: not enough ':'" << std::endl; -- cgit v1.2.3