- Truncate descriptions
Activity
I'm not thrilled with the comment syntax; nothing else does comments that way. If I understand right, the syntax is something like this?
ExcludeNodes \ # Node1337 is run by the Bavarian Illuminati \ Node1337, \ # The operator of Node99 looked at me funny \ Node99
It changes the meaning of # and , since you can no longer interpret # as "Ignore the rest of the line" and you can no longer interpret \ as "combine this line and the next, then process". Instead you need to treat # as meaning "Ignore the rest of the line except for a \ if the \ is at the end." It also changes the semantics of previously valid torrcs, such as
ContactInfo UberUser <uber@user.com> # /// Don't use my real email here! \\\ Log info file /home/nick.mathewson/projects/tor-info.log
Contrived, I admit.
I'm okay saying either "No comments for you" here, or with adding a comment/continuation syntax that doesn't change the meaning of old torrcs.
The comment syntax is supposed to be like this:
ExcludeNodes \ # Node1337 is run by the Bavarian Illuminati Node1337, \ # The operator of Node99 looked at me funny Node99
If you look at the unit test that I added, that should totally work. I also added a unit test for your example case to my branch, and that works, too. Did the commit that added a comment to the manpage have confusing words, or was the code confusing, or am I still missing something? Thanks!
hm. that looks better than what I thought it did. I wonder if we can get the manpage to explain this with an example. Somebody could still screw this up with something like
ExcludeNodes \ # START OF NODES \ # a looked at me funny \ a, \ # b is run by the mafia \ b, \ # END OF NODES Contact ,commamaster
But that isnt' too plausible.
I would rather have the ability to add comments than worry about that case, because it seems that the main reason why we do this anyways is that people want comments for specific entries. It would be great to get feedback from someone who actually cared for the feature.
I'll add an example to the manpage in a couple of days.
I tweaked it in branch continuation in my repository.
I think, among other things, I removed a condition where we could run off the end of the string. When you did:
} else if (*line == '#') { do { ++line; } while (*line && *line != '\n') } ++line; // OOPS
consider what would happen when the last line in the file had a comment with no newline at the end. The loop would continue until *line=='\0', and then the second increment (marked "OOPS" above) would advance the line one more character. Ouch!
And a completely cosmetic thing: It seems odd to day "Implements bug 1929". Implementing a bug sounds like you're putting it into the code. Since this is really a feature rather than a bugfix, I'm going with "resolves bug 1929", but "resolves ticket 1929" would also sound ok to me.