--- ../povray3orig/povray-3.7.0.RC3/vfe/unix/unixoptions.cpp	2011-07-06 15:27:21.094198133 +0200
+++ vfe/unix/unixoptions.cpp	2011-07-06 15:25:38.956092924 +0200
@@ -809,11 +809,12 @@
         if(!user_mode)
             paths = m_permitted_paths;
 
-        // read in file
-        while ( !Stream.eof() )
+        // Read file loop start:
+        // Try to iteratively get line from Stream
+        // Abort in case of badbit or failbit
+        while(std::getline(Stream, line))
         {
-            // get and preprocess line
-            std::getline(Stream, line);
+            // preprocess line
             line = pre_process_conf_line(line);
             ++line_number;
 
@@ -990,7 +991,16 @@
             else if(section == PERMITTED_PATHS)
                 add_permitted_path(paths, line, conf_name, line_number);
 
-        }  // read in file
+        }  // Read file loop end
+        // Only in case of the badbit we can assume that some lower
+        // level system API function has set errno. Then, perror() can be
+        // used safely.
+        if(Stream.bad())
+        {
+            fprintf(stderr, "%s: error while reading/opening config file ", PACKAGE);
+            perror(conf_name.c_str());
+        }
+
 
 #ifdef UNIX_DEBUG
         fprintf(stderr,
