diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2012-07-09 17:38:06 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2012-07-09 17:38:06 +0200 |
commit | 947878508fbd153766a9ded131a04260ca4c7a83 (patch) | |
tree | 3d5e0dfdef12bed9c9b8107d30d6249f87fc0ded | |
parent | 545ba6bdd8cb77ceca6b9fdc935db2accbea3493 (diff) |
* apt-pkg/contrib/strutl.cc:
- support \n and \r\n line endings in ReadMessages
-rw-r--r-- | apt-pkg/contrib/strutl.cc | 5 | ||||
-rw-r--r-- | debian/changelog | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index ca096d736..df11a80ad 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -752,7 +752,8 @@ bool ReadMessages(int Fd, vector<string> &List) // Look for the end of the message for (char *I = Buffer; I + 1 < End; I++) { - if (I[0] != '\n' || I[1] != '\n') + if (I[1] != '\n' || + (strncmp(I, "\n\n", 2) != 0 && strncmp(I, "\r\n\r\n", 4) != 0)) continue; // Pull the message out @@ -760,7 +761,7 @@ bool ReadMessages(int Fd, vector<string> &List) PartialMessage += Message; // Fix up the buffer - for (; I < End && *I == '\n'; I++); + for (; I < End && (*I == '\r' || *I == '\n'); ++I); End -= I-Buffer; memmove(Buffer,I,End-Buffer); I = Buffer; diff --git a/debian/changelog b/debian/changelog index 1505aad53..7a8c63d04 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +apt (0.9.8~exp1) UNRELEASED; urgency=low + + [ David Kalnischkies ] + * apt-pkg/contrib/strutl.cc: + - support \n and \r\n line endings in ReadMessages + + -- David Kalnischkies <kalnischkies@gmail.com> Mon, 09 Jul 2012 17:36:40 +0200 + apt (0.9.7.1) unstable; urgency=low [ Program translation updates ] |