File reproducible.patch of Package doxygen

Index: doxygen-1.8.13/qtools/qdir_unix.cpp
===================================================================
--- doxygen-1.8.13.orig/qtools/qdir_unix.cpp
+++ doxygen-1.8.13/qtools/qdir_unix.cpp
@@ -205,11 +205,12 @@ bool QDir::readDirEntries( const QString
     //QRegExp   wc( nameFilter, TRUE, TRUE );	// wild card, case sensitive
 #endif
     QFileInfo fi;
-    DIR	     *dir;
+    int n;
+    dirent **namelist;
     dirent   *file;
 
-    dir = opendir( QFile::encodeName(dPath) );
-    if ( !dir ) {
+    n = scandir(QFile::encodeName(dPath), &namelist, NULL, alphasort);
+    if ( n == -1 ) {
 #if defined(CHECK_NULL)
 	qWarning( "QDir::readDirEntries: Cannot read the directory: %s",
 		  QFile::encodeName(dPath).data() );
@@ -217,9 +218,11 @@ bool QDir::readDirEntries( const QString
 	return FALSE;
     }
 
-    while ( (file = readdir(dir)) ) {
+    while ( n-- ) {
+	file = namelist[n];
 	QString fn = QFile::decodeName(file->d_name);
 	fi.setFile( *this, fn );
+	free( file );
 	if ( !match( filters, fn ) && !(allDirs && fi.isDir()) )
 	     continue;
 	if  ( (doDirs && fi.isDir()) || (doFiles && fi.isFile()) ) {
@@ -237,12 +240,7 @@ bool QDir::readDirEntries( const QString
 	    fiList->append( new QFileInfo( fi ) );
 	}
     }
-    if ( closedir(dir) != 0 ) {
-#if defined(CHECK_NULL)
-	qWarning( "QDir::readDirEntries: Cannot close the directory: %s",
-		  dPath.local8Bit().data() );
-#endif
-    }
+    free(namelist);
 
     // Sort...
     if(fiList->count()) {
openSUSE Build Service is sponsored by