From 1e850cd874327701891292644b3c8a88f5031161 Mon Sep 17 00:00:00 2001 From: dubhater Date: Tue, 30 Jan 2018 23:44:12 +0200 Subject: [PATCH] Qt: Fix assert with one-letter root folder names An assertion failure happens shortly after opening the "Torrent properties" dialog if the torrent's root folder has a one-letter name, e. g. A/ A/Some Linux distro.iso A/Some other Linux distro.iso Off by one errors are great, eh? This fixes https://trac.transmissionbt.com/ticket/6141 --- qt/FileTreeModel.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt/FileTreeModel.cc b/qt/FileTreeModel.cc index f9696900e..a1ed8cd6e 100644 --- a/qt/FileTreeModel.cc +++ b/qt/FileTreeModel.cc @@ -47,7 +47,7 @@ public: bool hasNext() const { - return mySlashIndex > 0; + return mySlashIndex > -1; } QString const& next()