Changeset 1398 for trunk/dll/pathutil.c
- Timestamp:
- Feb 21, 2009, 6:43:00 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/pathutil.c
r1394 r1398 37 37 #include "wrappers.h" // xmalloc 38 38 #include "fortify.h" 39 #include "stristr.h" //stristr 39 40 40 41 static PSZ pszSrcFile = __FILE__; … … 51 52 */ 52 53 53 PSZ BldFullPathName(PSZ pszFullPathName, P SZ pszPathName, PSZ pszFileName)54 PSZ BldFullPathName(PSZ pszFullPathName, PCSZ pszPathName, PCSZ pszFileName) 54 55 { 55 56 UINT c = pszPathName ? strlen(pszPathName) : 0; … … 70 71 */ 71 72 72 PSZ BldQuotedFullPathName(PSZ pszFullPathName, P SZ pszPathName, PSZ pszFileName)73 PSZ BldQuotedFullPathName(PSZ pszFullPathName, PCSZ pszPathName, PCSZ pszFileName) 73 74 { 74 75 UINT c = pszPathName ? strlen(pszPathName) : 0; … … 146 147 strcpy(szCmdLine, pszCmdLine_); 147 148 if (szCmdLine[0] != '\0') { 148 offsetexe = str str(strlwr(pszCmdLine_), ".exe");149 offsetcmd = str str(strlwr(pszCmdLine_), ".cmd");150 offsetcom = str str(strlwr(pszCmdLine_), ".com");151 offsetbtm = str str(strlwr(pszCmdLine_), ".btm");152 offsetbat = str str(strlwr(pszCmdLine_), ".bat");149 offsetexe = stristr(pszCmdLine_, PCSZ_DOTEXE); 150 offsetcmd = stristr(pszCmdLine_, PCSZ_DOTCMD); 151 offsetcom = stristr(pszCmdLine_, PCSZ_DOTCOM); 152 offsetbtm = stristr(pszCmdLine_, PCSZ_DOTBTM); 153 offsetbat = stristr(pszCmdLine_, PCSZ_DOTBAT); 153 154 if (offsetexe) 154 155 offset = offsetexe; … … 184 185 pszCmdLine_); 185 186 if (!offsetexe && !offsetcom) { 186 FullPath = searchapath( "PATH", szCmdLine);187 FullPath = searchapath(PCSZ_PATH, szCmdLine); 187 188 if (*FullPath) 188 189 ret = 0; … … 224 225 ret = DosQueryAppType(szCmdLine, &ulAppType); // exe automatically appended 225 226 if (!ret) 226 strcat(szCmdLine, ".exe");227 strcat(szCmdLine, PCSZ_DOTEXE); 227 228 else { 228 strcat(szCmdLine, ".com");229 strcat(szCmdLine, PCSZ_DOTCOM); 229 230 ret = DosQueryAppType(szCmdLine, &ulAppType); 230 231 if (ret) { 231 232 offset = strrchr(szCmdLine, '.' ); 232 233 *offset = 0; 233 strcat(szCmdLine, ".cmd");234 FullPath = searchapath( "PATH", szCmdLine);234 strcat(szCmdLine, PCSZ_DOTCMD); 235 FullPath = searchapath(PCSZ_PATH, szCmdLine); 235 236 if (*FullPath) 236 237 ret = 0; 237 238 else { 238 239 *offset = 0; 239 strcat(szCmdLine, ".bat");240 FullPath = searchapath( "PATH", szCmdLine);240 strcat(szCmdLine, PCSZ_DOTBAT); 241 FullPath = searchapath(PCSZ_PATH, szCmdLine); 241 242 if (*FullPath) 242 243 ret = 0; 243 244 else { 244 245 *offset = 0; 245 strcat(szCmdLine, ".bmt");246 FullPath = searchapath( "PATH", szCmdLine);246 strcat(szCmdLine, PCSZ_DOTBTM); 247 FullPath = searchapath(PCSZ_PATH, szCmdLine); 247 248 if (*FullPath) 248 249 ret = 0; … … 262 263 ret = DosQueryAppType(szCmdLine, &ulAppType); 263 264 if (!ret) { 264 strcat(szCmdLine, ".exe");265 strcat(szCmdLine, PCSZ_DOTEXE); 265 266 break; 266 267 } 267 268 else { 268 strcat(szCmdLine, ".com");269 strcat(szCmdLine, PCSZ_DOTCOM); 269 270 ret = DosQueryAppType(szCmdLine, &ulAppType); 270 271 if (ret) { 271 272 offset = strrchr(szCmdLine, '.' ); 272 273 *offset = 0; 273 strcat(szCmdLine, ".cmd");274 FullPath = searchapath( "PATH", szCmdLine);274 strcat(szCmdLine, PCSZ_DOTCMD); 275 FullPath = searchapath(PCSZ_PATH, szCmdLine); 275 276 if (*FullPath) { 276 277 ret = 0; … … 279 280 else { 280 281 *offset = 0; 281 strcat(szCmdLine, ".bat");282 FullPath = searchapath( "PATH", szCmdLine);282 strcat(szCmdLine, PCSZ_DOTBAT); 283 FullPath = searchapath(PCSZ_PATH, szCmdLine); 283 284 if (*FullPath) { 284 285 ret = 0; … … 287 288 else { 288 289 *offset = 0; 289 strcat(szCmdLine, ".bmt");290 FullPath = searchapath( "PATH", szCmdLine);290 strcat(szCmdLine, PCSZ_DOTBTM); 291 FullPath = searchapath(PCSZ_PATH, szCmdLine); 291 292 if (*FullPath) { 292 293 ret = 0; … … 349 350 GetPString(IDS_QUOTESINARGSTEXT), 350 351 pszCmdLine_); 351 FullPath = searchapath( "PATH", szCmdLine);352 FullPath = searchapath(PCSZ_PATH, szCmdLine); 352 353 BldQuotedFileName(pszNewCmdLine, szCmdLine); 353 354 //printf("%d %s ", ret, szCmdLine); fflush(stdout);
Note:
See TracChangeset
for help on using the changeset viewer.