Changeset 29193 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- May 7, 2010 9:57:16 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
r28943 r29193 363 363 } 364 364 365 CHECK_ERROR_BREAK(guest, GetProcessOutput(uPID, 0 /* aFlags */, 366 u32TimeoutMS, _64K, ComSafeArrayAsOutParam(aOutputData))); 367 cbOutputData = aOutputData.size(); 368 if (cbOutputData > 0) 369 { 370 /* aOutputData has a platform dependent line ending, standardize on 371 * Unix style, as RTStrmWrite does the LF -> CR/LF replacement on 372 * Windows. Otherwise we end up with CR/CR/LF on Windows. */ 373 ULONG cbOutputDataPrint = cbOutputData; 374 for (BYTE *s = aOutputData.raw(), *d = s; 375 s - aOutputData.raw() < (ssize_t)cbOutputData; 376 s++, d++) 365 if ( waitForStdOut 366 || waitForStdErr) 367 { 368 CHECK_ERROR_BREAK(guest, GetProcessOutput(uPID, 0 /* aFlags */, 369 u32TimeoutMS, _64K, ComSafeArrayAsOutParam(aOutputData))); 370 cbOutputData = aOutputData.size(); 371 if (cbOutputData > 0) 377 372 { 378 if (*s == '\r') 373 /* aOutputData has a platform dependent line ending, standardize on 374 * Unix style, as RTStrmWrite does the LF -> CR/LF replacement on 375 * Windows. Otherwise we end up with CR/CR/LF on Windows. */ 376 ULONG cbOutputDataPrint = cbOutputData; 377 for (BYTE *s = aOutputData.raw(), *d = s; 378 s - aOutputData.raw() < (ssize_t)cbOutputData; 379 s++, d++) 379 380 { 380 /* skip over CR, adjust destination */ 381 d--; 382 cbOutputDataPrint--; 381 if (*s == '\r') 382 { 383 /* skip over CR, adjust destination */ 384 d--; 385 cbOutputDataPrint--; 386 } 387 else if (s != d) 388 *d = *s; 383 389 } 384 else if (s != d) 385 *d = *s; 390 RTStrmWrite(g_pStdOut, aOutputData.raw(), cbOutputDataPrint); 386 391 } 387 RTStrmWrite(g_pStdOut, aOutputData.raw(), cbOutputDataPrint);388 392 } 389 393
Note:
See TracChangeset
for help on using the changeset viewer.