[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdelibs/kdoctools
From:       Dirk Mueller <mueller () kde ! org>
Date:       2003-07-26 20:42:49
[Download RAW message or body]

CVS commit by mueller: 

factor 512 speedup


  M +7 -8      meinproc.cpp   1.32


--- kdelibs/kdoctools/meinproc.cpp  #1.31:1.32
@@ -161,12 +161,11 @@ int main(int argc, char **argv) {
             cmd += " 2>&1";
             FILE *xmllint = popen( QFile::encodeName( cmd ), "r");
+            char buf[ 512 ];
             bool noout = true;
-            while ( !feof( xmllint ) ) {
-                int c;
-                c = fgetc( xmllint );
-                if ( c != EOF ) {
-                    fputc( c, stderr );
+            unsigned int n;
+            while ( ( n = fread(buf, 1, sizeof( buf ), xmllint ) ) ) {
                     noout = false;
-                }
+                buf[ n ] = '\0';
+                fputs( buf, stderr );
             }
             pclose( xmllint );


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic