diff options
Diffstat (limited to '')
| -rw-r--r-- | src/context.cpp | 6 | ||||
| -rw-r--r-- | src/functionexecute.cpp | 3 | ||||
| -rw-r--r-- | src/functiongetmakedeps.cpp | 3 |
3 files changed, 8 insertions, 4 deletions
diff --git a/src/context.cpp b/src/context.cpp index 64b3bd0..1125248 100644 --- a/src/context.cpp +++ b/src/context.cpp | |||
| @@ -220,11 +220,13 @@ Bu::FString Context::expand( const Bu::FString &sInS ) | |||
| 220 | { | 220 | { |
| 221 | //sio << "Executing command: >>>" << sCmd << "<<<" << sio.nl; | 221 | //sio << "Executing command: >>>" << sCmd << "<<<" << sio.nl; |
| 222 | Process p( Process::StdOut, "/bin/bash", "/bin/bash", "-c", sCmd.getStr(), NULL ); | 222 | Process p( Process::StdOut, "/bin/bash", "/bin/bash", "-c", sCmd.getStr(), NULL ); |
| 223 | while( p.isRunning() ) | 223 | char buf[4096]; |
| 224 | do | ||
| 224 | { | 225 | { |
| 225 | char buf[4096]; | ||
| 226 | sBuf.append( buf, p.read( buf, 4096 ) ); | 226 | sBuf.append( buf, p.read( buf, 4096 ) ); |
| 227 | } | 227 | } |
| 228 | while( p.isRunning() ); | ||
| 229 | sBuf.append( buf, p.read( buf, 4096 ) ); | ||
| 228 | sBuf = sBuf.replace("\n", " ").replace("\r", " "); | 230 | sBuf = sBuf.replace("\n", " ").replace("\r", " "); |
| 229 | sBuf.trimBack(' '); | 231 | sBuf.trimBack(' '); |
| 230 | sRet.append( sBuf ); | 232 | sRet.append( sBuf ); |
diff --git a/src/functionexecute.cpp b/src/functionexecute.cpp index f692036..0b0aabf 100644 --- a/src/functionexecute.cpp +++ b/src/functionexecute.cpp | |||
| @@ -31,7 +31,7 @@ Variable FunctionExecute::call( Variable &/*input*/, VarList lParams ) | |||
| 31 | Process pCmd( Process::Both, "/bin/bash", "/bin/bash", "-c", | 31 | Process pCmd( Process::Both, "/bin/bash", "/bin/bash", "-c", |
| 32 | lParams.first().getString().getStr(), NULL ); | 32 | lParams.first().getString().getStr(), NULL ); |
| 33 | FString sStdOut, sStdErr; | 33 | FString sStdOut, sStdErr; |
| 34 | while( pCmd.isRunning() ) | 34 | do |
| 35 | { | 35 | { |
| 36 | char buf[4096]; | 36 | char buf[4096]; |
| 37 | bool out, err; | 37 | bool out, err; |
| @@ -49,6 +49,7 @@ Variable FunctionExecute::call( Variable &/*input*/, VarList lParams ) | |||
| 49 | //sio << "Read " << iRead << " bytes of stdout." << sio.nl; | 49 | //sio << "Read " << iRead << " bytes of stdout." << sio.nl; |
| 50 | } | 50 | } |
| 51 | } | 51 | } |
| 52 | while( pCmd.isRunning() ); | ||
| 52 | 53 | ||
| 53 | pContext->getView()->cmdFinished( | 54 | pContext->getView()->cmdFinished( |
| 54 | sStdOut, sStdErr, pCmd.childExitStatus() | 55 | sStdOut, sStdErr, pCmd.childExitStatus() |
diff --git a/src/functiongetmakedeps.cpp b/src/functiongetmakedeps.cpp index cc6cbbb..cfe5459 100644 --- a/src/functiongetmakedeps.cpp +++ b/src/functiongetmakedeps.cpp | |||
| @@ -31,12 +31,13 @@ Variable FunctionGetMakeDeps::call( Variable &/*input*/, VarList lParams ) | |||
| 31 | 31 | ||
| 32 | // Gather all data from the command. | 32 | // Gather all data from the command. |
| 33 | Bu::FString sBuf; | 33 | Bu::FString sBuf; |
| 34 | while( !p.isEos() ) | 34 | do |
| 35 | { | 35 | { |
| 36 | char buf[4096]; | 36 | char buf[4096]; |
| 37 | int iRead = p.read( buf, 4096 ); | 37 | int iRead = p.read( buf, 4096 ); |
| 38 | sBuf.append( buf, iRead ); | 38 | sBuf.append( buf, iRead ); |
| 39 | } | 39 | } |
| 40 | while( !p.isEos() ); | ||
| 40 | 41 | ||
| 41 | pContext->getView()->cmdFinished( "", "", p.childExitStatus() ); | 42 | pContext->getView()->cmdFinished( "", "", p.childExitStatus() ); |
| 42 | 43 | ||
