TODO: Use libc basename function ------------------------------------------------------------------------- strip_path Utility func to strip path from a filename (= _basename cmd on unix) Input: filename Output : None Return Value: Filename with path stripped -------------------------------------------------------------------------*/
| 428 | Filename with path stripped |
| 429 | -------------------------------------------------------------------------*/ |
| 430 | static const char * |
| 431 | _basename(const char *filename) |
| 432 | { |
| 433 | const char *cptr; |
| 434 | const char *ptr = filename; |
| 435 | |
| 436 | while ((cptr = strchr(ptr, '/')) != nullptr) { |
| 437 | ptr = cptr + 1; |
| 438 | } |
| 439 | return ptr; |
| 440 | } |
| 441 | |
| 442 | /*------------------------------------------------------------------------- |
| 443 | psi_include |