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:
rakshasa
2005-06-26 19:51:20 +00:00
parent 28b369dc83
commit 2c5ce1989a
15 changed files with 118 additions and 64 deletions
+11 -6
View File
@@ -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);
}