Commit 9e820fd2 authored by Matt Traudt's avatar Matt Traudt Committed by Matt Traudt
Browse files

Change a little parsing code to perserve spaces

This torrc line
    FooKey valuea   valueb
    key="FooKey", value="valuea   valueb"
Instead of
    key="FooKey", value="valuea valueb"

I don't think Tor ever cares, but just in case.
parent 6e413483
......@@ -184,12 +184,11 @@ def launch_tor(conf):
# The way stem handles configuring Tor with a dictionary is the first
# word is a key and the remaining words are the value.
items = line.split()
if len(items) < 2:
kv = line.split(None, 1)
if len(kv) < 2:
fail_hard('All torrc lines must have 2 or more words. "%s" has '
'fewer', line)
key, *value = items
value = ' '.join(value)
key, value = kv'Adding "%s %s" to torrc with which we are launching Tor',
key, value)
# It's really easy to add to the torrc if the key doesn't exist
Markdown is supported
0% or .
Finish editing this message first!
Please register or to comment