/ Extract from a path name the required component. */ This function assumes there is enough space in the buffer. */ /
| 405 | /* This function assumes there is enough space in the buffer. */ |
| 406 | /***********************************************************************/ |
| 407 | char *ExtractFromPath(PGLOBAL g, char *pBuff, char *FileName, OPVAL op) |
| 408 | { |
| 409 | char *drive = NULL, *direc = NULL, *fname = NULL, *ftype = NULL; |
| 410 | |
| 411 | switch (op) { // Determine which part to extract |
| 412 | #if defined(_WIN32) |
| 413 | case OP_FDISK: drive = pBuff; break; |
| 414 | #endif // !UNIX |
| 415 | case OP_FPATH: direc = pBuff; break; |
| 416 | case OP_FNAME: fname = pBuff; break; |
| 417 | case OP_FTYPE: ftype = pBuff; break; |
| 418 | default: |
| 419 | snprintf(g->Message, sizeof(g->Message), MSG(INVALID_OPER), op, "ExtractFromPath"); |
| 420 | return NULL; |
| 421 | } // endswitch op |
| 422 | |
| 423 | // Now do the extraction |
| 424 | _splitpath(FileName, drive, direc, fname, ftype); |
| 425 | return pBuff; |
| 426 | } // end of PlgExtractFromPath |
| 427 | |
| 428 | |
| 429 | #ifdef NOT_USED |
no test coverage detected