1: /*
   2: ** basename.c
   3: **
   4: ** return the last portion of a path name.
   5: ** included by all the cxref component programs.
   6: **
   7: ** Arnold Robbins, Information and Computer Science, Georgia Tech
   8: **	gatech!arnold
   9: ** Copyright (c) 1984 by Arnold Robbins.
  10: ** All rights reserved.
  11: ** This program may not be sold, but may be distributed
  12: ** provided this header is included.
  13: */
  14: 
  15: char *basename(str) /* return last portion of a path name */
  16: char *str;
  17: {
  18:     char *cp, *rindex();    /* change to strrchr() for USG systems */
  19: 
  20:     if((cp = rindex(str, '/')) == NULL)
  21:         return(str);
  22:     else
  23:         return(++cp);
  24: }
Last modified: 1991-11-05
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1005
Valid CSS Valid XHTML 1.0 Strict