Browse Source

Fix bug in borland run command

Ken Martin 23 years ago
parent
commit
8cac76825f
1 changed files with 6 additions and 9 deletions
  1. 6 9
      Source/cmSystemTools.cxx

+ 6 - 9
Source/cmSystemTools.cxx

@@ -1414,12 +1414,6 @@ bool WindowsRunCommand(const char* command, const char* dir,
 //main program loop 
 //main program loop 
     {
     {
     Sleep(10);
     Sleep(10);
-    //std::cout << "Check for process..." << std::endl;
-    GetExitCodeProcess(pi.hProcess,&exit);
- 
-//while the process is running 
-    if (exit != STILL_ACTIVE) break;
- 
 //check to see if there is any data to read from stdout 
 //check to see if there is any data to read from stdout 
     //std::cout << "Peek for data..." << std::endl;
     //std::cout << "Peek for data..." << std::endl;
     PeekNamedPipe(read_stdout,buf,1023,&bread,&avail,NULL);
     PeekNamedPipe(read_stdout,buf,1023,&bread,&avail,NULL);
@@ -1441,23 +1435,26 @@ bool WindowsRunCommand(const char* command, const char* dir,
             std::cout << buf << std::flush; 
             std::cout << buf << std::flush; 
             }
             }
           }
           }
-        output += "\n";          
         }
         }
       else 
       else 
         {
         {
         ReadFile(read_stdout,buf,1023,&bread,NULL);
         ReadFile(read_stdout,buf,1023,&bread,NULL);
         output += buf;
         output += buf;
-        output += "\n";
         if(verbose) 
         if(verbose) 
           {
           {
           std::cout << buf << std::flush;
           std::cout << buf << std::flush;
- 
           }
           }
  
  
         }
         }
  
  
       }
       }
  
  
+    //std::cout << "Check for process..." << std::endl;
+    GetExitCodeProcess(pi.hProcess,&exit);
+ 
+//while the process is running 
+    if (exit != STILL_ACTIVE) break;
+ 
     }
     }
   CloseHandle(pi.hThread);
   CloseHandle(pi.hThread);
   CloseHandle(pi.hProcess);
   CloseHandle(pi.hProcess);