Changeset 1761 for trunk/dll/srchpath.c
- Timestamp:
- Mar 22, 2014, 12:29:52 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/srchpath.c
r1750 r1761 15 15 17 JAN 10 GKY Changes to get working with Watcom 1.9 Beta (1/16/10). Mostly cast CHAR CONSTANT * as CHAR *. 16 16 01 Mar 14 JBS Ticket #524: Made "searchapath" thread-safe. Function names and signatures were changed. 17 21 Mar 14 SHL SearchPathForFile: use IsAbsolutePath 17 18 18 19 ***********************************************************************/ … … 106 107 * SearchPathForFile: Search for a file along a path 107 108 * 108 * @param p Pathname: the name of a path environment variable (input)109 * Used only if pFilename has no directory separators or ':' for a drive sepcification109 * @param pszEnvVarName: the name of a path environment variable (input) 110 * Used only if pFilename has not an absoluate path 110 111 * 111 112 * @param pFilename: the name of a file to search for (input) 112 * If the file name i ncludes a directory separator or the ':' for a drive specificationthen113 * If the file name is an absolute path then 113 114 * DosQueryPathInfo is used for the search 114 115 * else 115 * DosSearchPath is used, along with the p Pathname parameter116 * DosSearchPath is used, along with the pszEnvVarName parameter 116 117 * 117 118 * @param pFullFilename: address of where to place fully-qulified name if search succeeds (output) … … 121 122 * 122 123 */ 123 APIRET SearchPathForFile(PCSZ p Pathname,124 APIRET SearchPathForFile(PCSZ pszEnvVarName, 124 125 PCSZ pFilename, 125 126 PCHAR pFullFilename) … … 128 129 CHAR szFullFilename[CCHMAXPATH]; 129 130 130 if (!p Pathname || !*pPathname || !pFilename || !*pFilename)131 if (!pszEnvVarName || !*pszEnvVarName || !pFilename || !*pFilename) 131 132 return ERROR_INVALID_PARAMETER; 132 133 133 if (strchr(pFilename, '\\') || strchr(pFilename, '/') 134 || strchr(pFilename, ':')) { 134 if (IsAbsolutePath(pFilename)) { 135 135 rc = DosQueryPathInfo(pFilename, FIL_QUERYFULLNAME, 136 (PVOID)szFullFilename, (ULONG) 136 (PVOID)szFullFilename, (ULONG)CCHMAXPATH-1); 137 137 } 138 138 else { 139 139 rc = DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT | 140 140 SEARCH_CUR_DIRECTORY, 141 (CHAR *) p Pathname,141 (CHAR *) pszEnvVarName, 142 142 (CHAR *) pFilename, 143 143 (PBYTE) szFullFilename, 144 144 CCHMAXPATH - 1); 145 145 } 146 if (!rc && pFullFilename) {146 if (!rc && pFullFilename) 147 147 strcpy(pFullFilename, szFullFilename); 148 } 148 149 149 return rc; 150 150 }
Note:
See TracChangeset
for help on using the changeset viewer.