[tor-commits] [vidalia/master] Fix for 6147 Can't edit torrc from within Vidalias' interface
chiiph at torproject.org
chiiph at torproject.org
Sat Feb 23 16:26:47 UTC 2013
commit 369c619a1808a0680b9e7cc99f4ec091430743ee
Author: karulis <karulis at debian>
Date: Sat Jul 14 18:42:28 2012 +0200
Fix for 6147 Can't edit torrc from within Vidalias' interface
---
src/vidalia/config/TorrcDialog.cpp | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/vidalia/config/TorrcDialog.cpp b/src/vidalia/config/TorrcDialog.cpp
index 3a08710..9871923 100644
--- a/src/vidalia/config/TorrcDialog.cpp
+++ b/src/vidalia/config/TorrcDialog.cpp
@@ -97,12 +97,15 @@ TorrcDialog::parseAndSet(QString *errmsg)
int i = 0;
foreach(QString line, lines) {
i++;
+ line = line.trimmed();
+
+ if(line.startsWith("#") || line.isEmpty())
+ continue; // Skip commentaries and empty lines
+
int commentIndex = line.indexOf("#");
if(commentIndex != -1)
- line = line.remove(commentIndex, line.length() - commentIndex);
+ line = line.mid(0, commentIndex).trimmed();
- line = line.trimmed();
- if(line.startsWith("#")) continue; // Skip commentaries
parts = line.split(" ", QString::SkipEmptyParts);
if(parts.count() < 2) {
*errmsg = tr("Error at line %1: \"%2\"").arg(i).arg(line);
More information about the tor-commits
mailing list