| 544 | } |
| 545 | |
| 546 | size_t path_ext_off(const char *path) |
| 547 | { |
| 548 | const char *dot, *base; |
| 549 | |
| 550 | dot = strrchr(path, '.'); |
| 551 | if (dot) { |
| 552 | base = strrchr(path, PATH_SEP); |
| 553 | if (!base) |
| 554 | base = path; |
| 555 | else |
| 556 | base++; |
| 557 | if (dot > base) |
| 558 | return dot - path; |
| 559 | } |
| 560 | return strlen(path); |
| 561 | } |
no outgoing calls