Changeset 51
- Timestamp:
- Jan 8, 2006, 8:51:18 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel/qprocess_pm.cpp
r44 r51 44 44 #include "qtimer.h" 45 45 #include "qregexp.h" 46 #include "qdir.h" 46 47 #include "private/qinternal_p.h" 47 48 #include "qt_os2.h" … … 285 286 envlist.resize( envlist.size() + 1 ); 286 287 envlist[ pos ++ ] = 0; 288 } else { 289 // copy the entire environment (to let all variables added using 290 // putenv() appear in the child process) 291 uint sz = 1; 292 for( const char * const *envp = environ; *envp != NULL; ++ envp ) 293 sz += strlen( *envp ) + 1; 294 envlist.resize( sz ); 295 uint pos = 0; 296 for( const char * const *envp = environ; *envp != NULL; ++ envp ) { 297 sz = strlen( *envp ) + 1; 298 memcpy( envlist.data() + pos, *envp, sz ); 299 pos += sz; 300 } 301 // add the terminating 0 302 envlist[ pos ++ ] = 0; 287 303 } 288 304 … … 605 621 } 606 622 623 // set the working directory 624 QString curDir = QDir::currentDirPath(); 625 QDir::setCurrent( workingDir.path() ); 626 #if defined(QT_QPROCESS_DEBUG) 627 DosPrintf( tmpStderr != HF_ANY ? tmpStderr : realStderr, 628 "QProcess::start(): curDir='%s', workingDir='%s'\n\r", 629 curDir.local8Bit().data(), 630 QDir::currentDirPath().local8Bit().data() ); 631 #endif 632 607 633 // DosExecPgm() 608 634 … … 611 637 rc = DosExecPgm( pathBuf, sizeof(pathBuf), EXEC_ASYNCRESULT, 612 638 buf.data(), envlist.data(), &resc, appNameFull.data() ); 639 640 // restore the current directory 641 QDir::setCurrent( curDir ); 613 642 614 643 // cancel STDIN/OUT/ERR redirections
Note:
See TracChangeset
for help on using the changeset viewer.