diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-11-10 16:10:55 +0100 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-11-10 16:10:55 +0100 |
commit | 37adedc9d0b66eeae7efb88aebd08dfbc6e06f77 (patch) | |
tree | b0769df88e2b6496f23e3d899aeb1c240a3488d9 /apt-pkg/contrib/strutl.cc | |
parent | cf4f17a9d87a36b20ef5afa2cb5145e466d8ad3b (diff) | |
parent | 04340db392f14e2610189db6f8787e10fbf3c6d0 (diff) |
merged from lp:~donkult/apt/experimental
Diffstat (limited to 'apt-pkg/contrib/strutl.cc')
-rw-r--r-- | apt-pkg/contrib/strutl.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index aaf44b7ff..861cdcbeb 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -179,14 +179,14 @@ bool ParseQuoteWord(const char *&String,string &Res) { if (*C == '"') { - for (C++; *C != 0 && *C != '"'; C++); - if (*C == 0) + C = strchr(C + 1, '"'); + if (C == NULL) return false; } if (*C == '[') { - for (C++; *C != 0 && *C != ']'; C++); - if (*C == 0) + C = strchr(C + 1, ']'); + if (C == NULL) return false; } } @@ -904,11 +904,10 @@ bool StrToTime(const string &Val,time_t &Result) { struct tm Tm; char Month[10]; - const char *I = Val.c_str(); - + // Skip the day of the week - for (;*I != 0 && *I != ' '; I++); - + const char *I = strchr(Val.c_str(), ' '); + // Handle RFC 1123 time Month[0] = 0; if (sscanf(I," %d %3s %d %d:%d:%d GMT",&Tm.tm_mday,Month,&Tm.tm_year, |