diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2010-09-24 13:32:27 +0200 |
---|---|---|
committer | Sebastian Hahn <sebastian@torproject.org> | 2010-09-24 13:32:27 +0200 |
commit | 851255170aaa419e9c8f2a7d1b3c7a124a9c2783 (patch) | |
tree | 42edda59d1350a3d5a538d055c66ccacd0799f4f /src | |
parent | 0a0cc4599fd743d124d6ee90671c7c8e205b86e8 (diff) | |
download | tor-851255170aaa419e9c8f2a7d1b3c7a124a9c2783.tar.gz tor-851255170aaa419e9c8f2a7d1b3c7a124a9c2783.zip |
Note that the torrc format doesn't need nl at end
Diffstat (limited to 'src')
-rw-r--r-- | src/common/util.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/common/util.c b/src/common/util.c index 904fd82239..abb2753c6e 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -2285,15 +2285,17 @@ const char * parse_config_line_from_str(const char *line, char **key_out, char **value_out) { /* I believe the file format here is supposed to be: - FILE = (EMPTYLINE | LINE)* + FILE = (EMPTYLINE | LINE)* (EMPTYLASTLINE | LASTLINE)? - EMPTYLINE = SPACE* NL | COMMENT NL + EMPTYLASTLINE = SPACE* | COMMENT + EMPTYLINE = EMPTYLASTLINE NL SPACE = ' ' | '\r' | '\t' COMMENT = '#' NOT-NL* NOT-NL = Any character except '\n' NL = '\n' - LINE = SPACE* KEY SPACE* VALUES NL + LASTLINE = SPACE* KEY SPACE* VALUES + LINE = LASTLINE NL KEY = KEYCHAR+ KEYCHAR = Any character except ' ', '\r', '\n', '\t', '#', "\" |