configure: Fix infinite loop displaying config.summary
authorJonathan Liu <net147@gmail.com>
Mon, 3 Sep 2012 10:54:33 +0000 (20:54 +1000)
committerQt by Nokia <qt-info@nokia.com>
Mon, 3 Sep 2012 11:41:55 +0000 (13:41 +0200)
Displaying config.summary sometimes results in an infinite loop because
the loop condition only checks that failbit and badbit are not set.
The eofbit may be set with failbit and badbit not set.

Change-Id: I209480fbf114365fd4fdf1289c988a386f9f2562
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
tools/configure/configureapp.cpp

index 7fc1c62..226214d 100644 (file)
@@ -3382,7 +3382,7 @@ void Configure::displayConfig()
 
     // display config.summary
     sout.seekg(0, ios::beg);
-    while (sout) {
+    while (sout.good()) {
         string str;
         getline(sout, str);
         cout << str << endl;