From 7cd3655e2e3edc630b21e495438c4b324c50c759 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 18 Jun 2010 19:49:31 +0000 Subject: Fixed some things that broke when Process changed it's functionality slightly. --- src/context.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/context.cpp') 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 ) { //sio << "Executing command: >>>" << sCmd << "<<<" << sio.nl; Process p( Process::StdOut, "/bin/bash", "/bin/bash", "-c", sCmd.getStr(), NULL ); - while( p.isRunning() ) + char buf[4096]; + do { - char buf[4096]; sBuf.append( buf, p.read( buf, 4096 ) ); } + while( p.isRunning() ); + sBuf.append( buf, p.read( buf, 4096 ) ); sBuf = sBuf.replace("\n", " ").replace("\r", " "); sBuf.trimBack(' '); sRet.append( sBuf ); -- cgit v1.2.3