Changeset 22040 for trunk/src/kernel32/oslibmisc.cpp
- Timestamp:
- Oct 25, 2012, 12:39:39 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/oslibmisc.cpp
r21648 r22040 267 267 //****************************************************************************** 268 268 //****************************************************************************** 269 char *OSLibStripPath(char *path) 270 { 271 /* @@@PH what does this function do ? Strip the path from a FQFN name ? */ 272 char *pszFilename; 273 char *pszFilename1; 274 275 pszFilename = strrchr(path, '\\'); /* find rightmost backslash */ 276 pszFilename1 = strrchr(path, '/'); /* find rightmost slash */ 277 if(pszFilename > pszFilename1 && pszFilename != NULL) 278 return (++pszFilename); /* return pointer to next character */ 279 280 if (pszFilename1 != NULL) 281 return (++pszFilename1); /* return pointer to next character */ 282 283 return (path); /* default return value */ 269 const char *OSLibStripPath(const char *path) 270 { 271 const char *pszName; 272 register char ch; 273 274 /* 275 * Search the filename string finding the modulename start and end. 276 * The loop ends when we have passed one char left of the module name. 277 */ 278 pszName = path + strlen(path) - 1; 279 while (pszName >= path 280 && (ch = *pszName) != '\\' 281 && ch != '/' 282 && ch != ':' 283 ) 284 { 285 pszName--; 286 } 287 pszName++; 288 289 return pszName; 284 290 } 285 291 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.