mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-15 22:52:31 +00:00
Added setting for session directory.
Added support for quotation in settings. Added key for changing the priority of all files in a torrent. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@477 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+11
-6
@@ -45,16 +45,21 @@ OptionFile::parse_line(const char* line) {
|
||||
if (line[0] == '#')
|
||||
return;
|
||||
|
||||
int result;
|
||||
char key[64];
|
||||
char opt[512];
|
||||
|
||||
int result;
|
||||
opt[0] = '\0';
|
||||
|
||||
// Check for empty lines, and options within "abc".
|
||||
if ((result = std::sscanf(line, "%64s = %512s", key, opt)) == 2)
|
||||
m_slotOption(key, opt);
|
||||
|
||||
// Don't throw on empty lines or lines with key and opt.
|
||||
if (result == 1)
|
||||
if ((result = std::sscanf(line, "%64s = \"%512[^\"]s", key, opt)) != 2 &&
|
||||
(result = std::sscanf(line, "%64s = %512s", key, opt)) != 2 &&
|
||||
result == 1)
|
||||
throw std::runtime_error("Error parseing option file.");
|
||||
|
||||
if (opt[0] == '"' && opt[1] == '"')
|
||||
opt[0] = '\0';
|
||||
|
||||
if (result >= 1)
|
||||
m_slotOption(key, opt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user