summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-method.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-10-30 13:48:05 -0500
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-10-30 13:48:05 -0500
commit89d88ac3ef3f82fdfeac6d8d231deddeeb0f02e9 (patch)
tree258687a5f0984f0b4edd24b52d778cf4d21c7059 /apt-pkg/acquire-method.cc
parentcd5e84440a9bb75a9cc2c142ac8bc214ba57685a (diff)
parent0a64ecd792b4caca519d597a69b8baeda6a1bf77 (diff)
merge with my debian-sid branch
Diffstat (limited to 'apt-pkg/acquire-method.cc')
-rw-r--r--apt-pkg/acquire-method.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/apt-pkg/acquire-method.cc b/apt-pkg/acquire-method.cc
index 1ae139b40..2041fd9e9 100644
--- a/apt-pkg/acquire-method.cc
+++ b/apt-pkg/acquire-method.cc
@@ -291,12 +291,12 @@ bool pkgAcqMethod::Configuration(string Message)
I += Length + 1;
for (; I < MsgEnd && *I == ' '; I++);
- const char *Equals = I;
- for (; Equals < MsgEnd && *Equals != '='; Equals++);
- const char *End = Equals;
- for (; End < MsgEnd && *End != '\n'; End++);
- if (End == Equals)
+ const char *Equals = (const char*) memchr(I, '=', MsgEnd - I);
+ if (Equals == NULL)
return false;
+ const char *End = (const char*) memchr(Equals, '\n', MsgEnd - Equals);
+ if (End == NULL)
+ End = MsgEnd;
Cnf.Set(DeQuoteString(string(I,Equals-I)),
DeQuoteString(string(Equals+1,End-Equals-1)));