[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [vidalia/master] Support comments in the same line as a config option



commit 3f6c16361cda0e5c0b2622111a220f98aaca2a98
Author: Tomás Touceda <chiiph@xxxxxxxxxxxxxx>
Date:   Sun Mar 25 17:15:34 2012 -0300

    Support comments in the same line as a config option
---
 src/vidalia/config/TorrcDialog.cpp |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/vidalia/config/TorrcDialog.cpp b/src/vidalia/config/TorrcDialog.cpp
index 08dd6a0..7f6a9c4 100644
--- a/src/vidalia/config/TorrcDialog.cpp
+++ b/src/vidalia/config/TorrcDialog.cpp
@@ -97,6 +97,10 @@ TorrcDialog::parseAndSet(QString *errmsg)
   int i = 0;
   foreach(QString line, lines) {
     i++;
+    int commentIndex = line.indexOf("#");
+    if(commentIndex != -1)
+      line = line.remove(commentIndex, line.length() - commentIndex);
+
     line = line.trimmed();
     if(line.startsWith("#")) continue; // Skip commentaries
     parts = line.split(" ", QString::SkipEmptyParts);



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits