[rkward] rkward: Fix off by one and typo

Thomas Friedrichsmeier null at kde.org
Tue Dec 31 10:51:49 GMT 2019


Git commit 69f0c52c048ed813054700d44a0501348ab1db5d by Thomas Friedrichsmeier.
Committed on 31/12/2019 at 10:51.
Pushed by tfry into branch 'master'.

Fix off by one and typo

M  +3    -3    rkward/main.cpp

https://commits.kde.org/rkward/69f0c52c048ed813054700d44a0501348ab1db5d

diff --git a/rkward/main.cpp b/rkward/main.cpp
index dfb8a1a3..4fdabc38 100644
--- a/rkward/main.cpp
+++ b/rkward/main.cpp
@@ -181,8 +181,8 @@ QString resolveRSpecOrFail (QString input, QString message) {
 			QDir dir (instroot);
 			QStringList candidates = dir.entryList ();
 			QVersionNumber highest (0, 0, 0);
-			for (int i = candidates.count (); i >= 0; --i) {
-				QString found = findExeAtPath ("Resoures/bin/R", dir.absoluteFilePath (candidates[i]));
+			for (int i = candidates.count () - 1; i >= 0; --i) {
+				QString found = findExeAtPath ("Resources/bin/R", dir.absoluteFilePath (candidates[i]));
 				if (!found.isNull()) {
 					QVersionNumber version = QVersionNumber::fromString (candidates[i]);
 					if (version > highest) {
@@ -199,7 +199,7 @@ QString resolveRSpecOrFail (QString input, QString message) {
 			QDir dir (instroot);
 			QStringList candidates = dir.entryList (QStringList ("R-*"), QDir::Dirs);
 			QVersionNumber highest (0, 0, 0);
-			for (int i = candidates.count (); i >= 0; --i) {
+			for (int i = candidates.count () - 1; i >= 0; --i) {
 				QString found = findExeAtPath ("bin/R", dir.absoluteFilePath (candidates[i]));
 				if (!found.isNull()) {
 					QVersionNumber version = QVersionNumber::fromString (candidates[i].mid (2));



More information about the rkward-tracker mailing list