home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / desklib / Libraries / Str / c / LeafName < prev    next >
Encoding:
Text File  |  1994-04-10  |  502 b   |  21 lines

  1. /*  Misc.LeafName.c
  2.  *  Copyright 1993 Erik de Kort
  3.  */
  4.  
  5. /* LeafName() --------------------------------------------------------------
  6.  * Return a pointer to the leaf of 'FullPath'.
  7.  * Note that this pointer is within the 'FullPath' string.
  8.  * If no '.' is encountered in FullPath, then the pointer FullPath is returned.
  9.  */
  10. extern char *LeafName(char *FullPath)
  11. {
  12.   char *Leaf, ch = '.';
  13.  
  14.   do
  15.   {
  16.     if (ch == '.')
  17.       Leaf = FullPath ;
  18.   } while((ch = *(FullPath++)) != '\0') ;
  19.   return(Leaf) ;
  20. }
  21.