Ticket #6147: vidalia-torrc.patch

File vidalia-torrc.patch, 1.2 KB (added by karulis, 8 years ago)

patch

  • src/vidalia/config/TorrcDialog.cpp

    From 7aa8b76bfaed67eb14c5dccb3db3b59173ae949f Mon Sep 17 00:00:00 2001
    From: karulis <karulis@debian>
    Date: Sat, 14 Jul 2012 18:42:28 +0200
    Subject: [PATCH] Fix for 6147 Can't edit torrc from within Vidalias'
     interface
    
    ---
     src/vidalia/config/TorrcDialog.cpp |    9 ++++++---
     1 file changed, 6 insertions(+), 3 deletions(-)
    
    diff --git a/src/vidalia/config/TorrcDialog.cpp b/src/vidalia/config/TorrcDialog.cpp
    index 3a08710..9871923 100644
    a b TorrcDialog::parseAndSet(QString *errmsg) 
    9797  int i = 0;
    9898  foreach(QString line, lines) {
    9999    i++;
     100    line = line.trimmed();
     101
     102    if(line.startsWith("#") || line.isEmpty())
     103      continue; // Skip commentaries and empty lines
     104
    100105    int commentIndex = line.indexOf("#");
    101106    if(commentIndex != -1)
    102       line = line.remove(commentIndex, line.length() - commentIndex);
     107      line = line.mid(0, commentIndex).trimmed();
    103108
    104     line = line.trimmed();
    105     if(line.startsWith("#")) continue; // Skip commentaries
    106109    parts = line.split(" ", QString::SkipEmptyParts);
    107110    if(parts.count() < 2) {
    108111      *errmsg = tr("Error at line %1: \"%2\"").arg(i).arg(line);