home *** CD-ROM | disk | FTP | other *** search
- /*
- ┌────────────────────────────────────────────────────────────────────────────┐
- │jzprsfil.c │
- │Parse out the file name and the path from a full path spec. │
- │Note that the path WILL contain a "\" after it ! │
- │Synopsis: │
- │ *fullpath = "\\MSC\\JAZ\\SOURCE"; │
- │ jzprsfil(fullpath,wpath,wfile); │
- │ printf("%s %s",wpath,wfile); { will output } │
- │ { \MSC\JAZ\ SOURCE } │
- │ │
- └────────────────────────────────────────────────────────────────────────────┘
- */
-
- jzprsfil(ffull,fpath,fsource)
- char *ffull,
- *fpath,
- *fsource;
- {
- int w;
-
- w = strlen(ffull) - 1;
-
- while ((w >= 0) && ((*(ffull+w) != ':') && (*(ffull+w) != '\\')))
- w --;
-
- if (w == -1) {
- *fpath = 0; /* return null path */
- strcpy(fsource,ffull); /* copy full path to source */
- }
- else {
- strncpy(fpath,ffull,++w);
- *(fpath+w) = 0; /* terminate the string */
-
- while (*fsource++ = *(ffull+w++))
- ;
- }
- }
-