]> granicus.if.org Git - nethack/commitdiff
Qt build fix
authorPatR <rankin@nethack.org>
Fri, 2 Oct 2020 11:51:15 +0000 (04:51 -0700)
committerPatR <rankin@nethack.org>
Fri, 2 Oct 2020 11:51:15 +0000 (04:51 -0700)
The failing Travis build issued about 500 lines of diagnostics
when complaining about one line of the source.  It compiled ok
for me but I use older versions of Qt library and C++ compiler.

win/Qt/qt_yndlg.cpp

index a696fdb92323dde054d85ec86921b01347a0291d..7ae167da23451f2c39b9fc8b77d06e94096ece24 100644 (file)
@@ -295,8 +295,8 @@ char NetHackQtYnDialog::Exec()
         // present in the QLineEdit widget doesn't affect its isEmpty() test
         if (le && !le->text().isEmpty()) {
             QString text(le->text());
-            if (text[0] == "#")
-                text = text.mid(1);
+            if (text.at(0) == QChar('#'))
+                text = text.mid(1); // rest of string past [0]
             ::yn_number = text.toLong();
             choice = '#';
         }