diff options
author | Mike Buland <eichlan@xagasoft.com> | 2010-06-18 19:49:31 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2010-06-18 19:49:31 +0000 |
commit | 7cd3655e2e3edc630b21e495438c4b324c50c759 (patch) | |
tree | 53de1076fc4b2099d421e33b399c24601b0e6540 /src/context.cpp | |
parent | e6d580738288c85a7eb50182aed4e7dba49d32f2 (diff) | |
download | build-7cd3655e2e3edc630b21e495438c4b324c50c759.tar.gz build-7cd3655e2e3edc630b21e495438c4b324c50c759.tar.bz2 build-7cd3655e2e3edc630b21e495438c4b324c50c759.tar.xz build-7cd3655e2e3edc630b21e495438c4b324c50c759.zip |
Fixed some things that broke when Process changed it's functionality slightly.
Diffstat (limited to '')
-rw-r--r-- | src/context.cpp | 6 |
1 files changed, 4 insertions, 2 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 ); |