From 964b3214587abc96f1774832df94ada4fbf726c4 Mon Sep 17 00:00:00 2001 From: Nick Tiskov Date: Sun, 3 Mar 2013 20:04:17 +0400 Subject: [PATCH] Ignore multiple sequential newlines in torrent creator --- src/torrentcreator/torrentcreatorthread.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/torrentcreator/torrentcreatorthread.cpp b/src/torrentcreator/torrentcreatorthread.cpp index 2179def46..84553b50d 100644 --- a/src/torrentcreator/torrentcreatorthread.cpp +++ b/src/torrentcreator/torrentcreatorthread.cpp @@ -114,12 +114,17 @@ void TorrentCreatorThread::run() { t.add_url_seed(seed.trimmed().toStdString()); } qint32 tier = 0; + bool newline = false; foreach (const QString &tracker, trackers) { if (tracker.isEmpty()) { + if (newline) + continue; ++tier; + newline = true; continue; } t.add_tracker(tracker.trimmed().toStdString(), tier); + newline = false; } if (abort) return; // calculate the hash for all pieces