+ if (Buffer != 0 && Buffer[0] == '[')
+ {
+ ++Buffer; // ignore the [
+ for (;Buffer != 0 && isspace(*Buffer); ++Buffer); // Skip whitespaces
+ while (*Buffer != ']')
+ {
+ // get one option, e.g. option1=value1
+ string option;
+ if (ParseQuoteWord(Buffer,option) == false)
+ return _error->Error(_("Malformed entry %u in %s file %s (%s)"), CurLine, "list", File.c_str(), "[option] unparseable");
+
+ if (option.length() < 3)
+ return _error->Error(_("Malformed entry %u in %s file %s (%s)"), CurLine, "list", File.c_str(), "[option] too short");
+
+ // accept options even if the last has no space before the ]-end marker
+ if (option.at(option.length()-1) == ']')
+ {
+ for (; *Buffer != ']'; --Buffer);
+ option.resize(option.length()-1);
+ }
+
+ size_t const needle = option.find('=');
+ if (needle == string::npos)
+ return _error->Error(_("Malformed entry %u in %s file %s (%s)"), CurLine, "list", File.c_str(), "[option] not assignment");
+
+ string const key = string(option, 0, needle);
+ string const value = string(option, needle + 1, option.length());
+
+ if (key.empty() == true)
+ return _error->Error(_("Malformed entry %u in %s file %s (%s)"), CurLine, "list", File.c_str(), "[option] no key");
+
+ if (value.empty() == true)
+ return _error->Error(_("Malformed entry %u in %s file %s (%s)"), CurLine, "list", File.c_str(), "[option] no value");
+
+ Options[key] = value;
+ }
+ ++Buffer; // ignore the ]
+ for (;Buffer != 0 && isspace(*Buffer); ++Buffer); // Skip whitespaces
+ }
+
+ string URI;
+ string Dist;
+ string Section;
+
+ if (ParseQuoteWord(Buffer,URI) == false)
+ return _error->Error(_("Malformed entry %u in %s file %s (%s)"), CurLine, "list", File.c_str(), "URI");
+ if (ParseQuoteWord(Buffer,Dist) == false)
+ return _error->Error(_("Malformed entry %u in %s file %s (%s)"), CurLine, "list", File.c_str(), "Suite");