Changeset 209 for trunk/src/helpers/apps.c
- Timestamp:
- Aug 19, 2002, 11:23:17 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/apps.c
r208 r209 879 879 // if the path has spaces, or other invalid characters, 880 880 // include it in quotes V0.9.21 (2002-08-12) [umoeller] 881 if (fQuotes = !!strpbrk(pProgDetails->pszExecutable, " +&| "))881 if (fQuotes = !!strpbrk(pProgDetails->pszExecutable, " +&|=")) 882 882 xstrcatc(pstrParams, '"'); 883 // @@bugbug "=" still doesn't work 883 884 884 885 #ifdef DEBUG_PROGRAMSTART … … 1165 1166 *@@changed V0.9.20 (2002-07-03) [umoeller]: fixed Win-OS/2 full screen breakage 1166 1167 *@@changed V0.9.20 (2002-07-03) [umoeller]: fixed broken bat and cmd files when PROG_DEFAULT was set 1168 *@@changed V0.9.21 (2002-08-18) [umoeller]: fixed cmd and bat files that had "=" in their paths 1167 1169 */ 1168 1170 … … 1347 1349 arc = ERROR_PATH_NOT_FOUND; 1348 1350 } 1351 1352 // V0.9.21: this define is never set. I have thus completely 1353 // disabled the batch hacks that we used to provide, that is 1354 // we no longer change the "c:\path\batch.cmd" to "cmd.exe /c c:\path\batch.cmd" 1355 // because it is perfectly valid to call WinStartApp with a 1356 // batch file. The problem with my code was that cmd.exe has 1357 // a weird bug in that if you give it something via /c that 1358 // has an equals character (=) in its path, e.g. "c:\path=path\batch.cmd", 1359 // the command parser apparently stops at the first "=" and 1360 // reports "c:\path" not found or something. What a bitch. 1361 #ifdef ENABLEBATCHHACKS 1349 1362 1350 1363 // we frequently get here for BAT and CMD files … … 1399 1412 break; 1400 1413 } // end switch (Details.progt.progc) 1414 #endif // ENABLEBATCHHACKS 1401 1415 } 1402 1416 } … … 2045 2059 *@@changed V0.9.20 (2002-08-10) [umoeller]: fixed missing destroy window, made wait optional 2046 2060 *@@changed V0.9.20 (2002-08-10) [umoeller]: added pcszWorkingDir 2047 */ 2048 2049 HAPP appQuickStartApp(const char *pcszFile, 2050 ULONG ulProgType, // e.g. PROG_PM 2051 const char *pcszArgs, // in: arguments (can be NULL) 2052 const char *pcszWorkingDir, // in: working dir (can be NULL) 2053 PULONG pulExitCode) // out: exit code; if ptr is NULL, we don't wait 2061 *@@changed V0.9.21 (2002-08-18) [umoeller]: changed prototype to return APIRET 2062 */ 2063 2064 APIRET appQuickStartApp(const char *pcszFile, 2065 ULONG ulProgType, // e.g. PROG_PM 2066 const char *pcszArgs, // in: arguments (can be NULL) 2067 const char *pcszWorkingDir, // in: working dir (can be NULL) 2068 HAPP *phapp, 2069 PULONG pulExitCode) // out: exit code; if ptr is NULL, we don't wait 2054 2070 { 2071 APIRET arc = NO_ERROR; 2055 2072 PROGDETAILS pd = {0}; 2056 HAPP happ, 2057 happReturn = NULLHANDLE; 2073 HAPP happReturn = NULLHANDLE; 2058 2074 CHAR szDir[CCHMAXPATH] = ""; 2059 2075 PCSZ p; … … 2077 2093 2078 2094 if ( (hwndObject = winhCreateObjectWindow(WC_STATIC, NULL)) 2079 && (! appStartApp(hwndObject,2080 &pd,2081 0,2082 &happ,2083 0,2084 NULL))2095 && (!(arc = appStartApp(hwndObject, 2096 &pd, 2097 0, 2098 phapp, 2099 0, 2100 NULL))) 2085 2101 ) 2086 2102 { 2087 2103 if (pulExitCode) 2088 2104 appWaitForApp(hwndObject, 2089 happ,2105 *phapp, 2090 2106 pulExitCode); 2091 2107 2092 happReturn = happ;2093 2094 2108 WinDestroyWindow(hwndObject); // was missing V0.9.20 (2002-08-10) [umoeller] 2095 2109 } 2096 2110 2097 return happReturn;2111 return arc; 2098 2112 } 2099 2113 … … 2103 2117 * URL. 2104 2118 * 2119 * We return TRUE if appQuickStartApp succeeded with 2120 * that URL. 2121 * 2105 2122 *@@added V0.9.20 (2002-08-10) [umoeller] 2106 2123 */ 2107 2124 2108 BOOL appOpenURL(PCSZ pcszURL) 2125 APIRET appOpenURL(PCSZ pcszURL, // in: URL to open 2126 PSZ pszAppStarted, // out: application that was started 2127 ULONG cbAppStarted) // in: size of that buffer 2109 2128 { 2110 BOOL brc = FALSE;2129 APIRET arc = NO_ERROR; 2111 2130 2112 2131 CHAR szBrowser[CCHMAXPATH], … … 2123 2142 sizeof(szBrowser))) 2124 2143 { 2125 PSZ pszDefParams; 2144 PSZ pszDefParams; 2145 HAPP happ; 2126 2146 2127 2147 if (pszDefParams = prfhQueryProfileData(HINI_USER, … … 2145 2165 2146 2166 2147 brc = !!appQuickStartApp(szBrowser, 2148 PROG_DEFAULT, 2149 strParameters.psz, 2150 szStartupDir, 2151 NULL); // don't wait 2167 arc = appQuickStartApp(szBrowser, 2168 PROG_DEFAULT, 2169 strParameters.psz, 2170 szStartupDir, 2171 &happ, 2172 NULL); // don't wait 2173 2174 if (pszAppStarted) 2175 strhncpy0(pszAppStarted, 2176 szBrowser, 2177 cbAppStarted); 2152 2178 } 2153 2179 2154 2180 xstrClear(&strParameters); 2155 2181 2156 return brc;2182 return arc; 2157 2183 }
Note:
See TracChangeset
for help on using the changeset viewer.