Changeset 217 for trunk/src/corelib
- Timestamp:
- Oct 9, 2009, 11:24:19 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/corelib/io/qprocess_os2.cpp
r216 r217 107 107 QT_BEGIN_NAMESPACE 108 108 109 110 109 111 enum 110 112 { … … 744 746 const QStringList *environment, bool detached = false) 745 747 { 746 // @todo P_DETACH isn't supported by kLIBC atm, do something else747 748 int mode = detached ? P_DETACH : P_NOWAIT; 748 749 749 // Create argument list with right number of elements, and set the final 750 // one to 0. 751 char **argv = new char *[arguments.count() + 2]; 750 // Create argument list with right number of elements (one extra is for 751 // the program name and one for the terminating 0). We also reserve 3 752 // elements in front of the array for a posssible command processor call 753 // insertion. 754 char **argvBase = new char *[arguments.count() + 2 + 3]; 755 756 // Don't use leading elements by default 757 char **argv = argvBase + 3; 758 // Set the final argument to 0 752 759 argv[arguments.count() + 1] = 0; 753 760 … … 902 909 } 903 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 904 963 // finally, start the thing 905 pid = spawnve(mode, fullProgramName, argv, envv); 964 pid = spawnve(mode, programReal, argvReal, envv); 965 966 #if defined(QPROCESS_DEBUG) 967 qDebug("qt_startProcess: pid %d", pid); 968 #endif 906 969 907 970 if (prependedLibPath) { … … 914 977 for (int i = 1 /* 0 is programName */; i <= arguments.count(); ++i) 915 978 delete [] argv[i]; 916 delete [] argv ;979 delete [] argv; 917 980 if (envv != environ) { 918 981 for (int i = 0; i < envc; ++i)
Note:
See TracChangeset
for help on using the changeset viewer.