aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/context.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/context.cpp b/src/context.cpp
index dc2e6a1..ce1dfee 100644
--- a/src/context.cpp
+++ b/src/context.cpp
@@ -219,7 +219,9 @@ Bu::String Context::expand( const Bu::String &sInS )
219 try 219 try
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,
223 "/bin/bash", "/bin/bash", "-c", sCmd.getStr(), NULL
224 );
223 char buf[4096]; 225 char buf[4096];
224 do 226 do
225 { 227 {
@@ -227,8 +229,8 @@ Bu::String Context::expand( const Bu::String &sInS )
227 } 229 }
228 while( p.isRunning() ); 230 while( p.isRunning() );
229 sBuf.append( buf, p.read( buf, 4096 ) ); 231 sBuf.append( buf, p.read( buf, 4096 ) );
230 sBuf = sBuf.replace("\n", " ").replace("\r", " "); 232 sBuf = sBuf.replace("\n", " ").replace("\r", " ").
231 sBuf.trimBack(' '); 233 trimWhitespace();
232 sRet.append( sBuf ); 234 sRet.append( sBuf );
233 } catch(...) 235 } catch(...)
234 { 236 {