mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-07 02:32:32 +00:00
* Optimized view filtering and sorting.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1213 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+20
-18
@@ -67,32 +67,34 @@ parse_string(const char* first, const char* last, std::string* dest, bool (*deli
|
||||
if (first == last)
|
||||
return first;
|
||||
|
||||
bool quoted = parse_is_quote(*first);
|
||||
|
||||
if (quoted)
|
||||
if (parse_is_quote(*first)) {
|
||||
first++;
|
||||
|
||||
while (first != last) {
|
||||
if (quoted) {
|
||||
while (first != last) {
|
||||
if (parse_is_quote(*first))
|
||||
return ++first;
|
||||
|
||||
} else {
|
||||
if (delim(*first))
|
||||
return first;
|
||||
}
|
||||
|
||||
if (parse_is_escape(*first) && ++first == last)
|
||||
throw torrent::input_error("Escape character at end of input.");
|
||||
if (parse_is_escape(*first) && ++first == last)
|
||||
throw torrent::input_error("Escape character at end of input.");
|
||||
|
||||
dest->push_back(*first++);
|
||||
}
|
||||
|
||||
dest->push_back(*first);
|
||||
first++;
|
||||
}
|
||||
|
||||
if (quoted)
|
||||
throw torrent::input_error("Missing closing quote.");
|
||||
|
||||
return first;
|
||||
} else {
|
||||
while (first != last) {
|
||||
if (delim(*first))
|
||||
return first;
|
||||
|
||||
if (parse_is_escape(*first) && ++first == last)
|
||||
throw torrent::input_error("Escape character at end of input.");
|
||||
|
||||
dest->push_back(*first++);
|
||||
}
|
||||
|
||||
return first;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user