mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Note that the torrc format doesn't need nl at end
This commit is contained in:
parent
0a0cc4599f
commit
851255170a
@ -2285,15 +2285,17 @@ const char *
|
|||||||
parse_config_line_from_str(const char *line, char **key_out, char **value_out)
|
parse_config_line_from_str(const char *line, char **key_out, char **value_out)
|
||||||
{
|
{
|
||||||
/* I believe the file format here is supposed to be:
|
/* 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'
|
SPACE = ' ' | '\r' | '\t'
|
||||||
COMMENT = '#' NOT-NL*
|
COMMENT = '#' NOT-NL*
|
||||||
NOT-NL = Any character except '\n'
|
NOT-NL = Any character except '\n'
|
||||||
NL = '\n'
|
NL = '\n'
|
||||||
|
|
||||||
LINE = SPACE* KEY SPACE* VALUES NL
|
LASTLINE = SPACE* KEY SPACE* VALUES
|
||||||
|
LINE = LASTLINE NL
|
||||||
KEY = KEYCHAR+
|
KEY = KEYCHAR+
|
||||||
KEYCHAR = Any character except ' ', '\r', '\n', '\t', '#', "\"
|
KEYCHAR = Any character except ' ', '\r', '\n', '\t', '#', "\"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user