]> granicus.if.org Git - transmission/commitdiff
Qt: Fix assert with one-letter root folder names
authordubhater <cantabile.desu@gmail.com>
Tue, 30 Jan 2018 21:44:12 +0000 (23:44 +0200)
committerGitHub <noreply@github.com>
Tue, 30 Jan 2018 21:44:12 +0000 (23:44 +0200)
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

index f9696900e1980c1faa65784bb82fb4df0b71a44a..a1ed8cd6efa55cf50473023fe1f517c22885d3e6 100644 (file)
@@ -47,7 +47,7 @@ public:
 
     bool hasNext() const
     {
-        return mySlashIndex > 0;
+        return mySlashIndex > -1;
     }
 
     QString const& next()