1: /* $Header: pathhead.c,v 1.2 85/03/08 17:21:50 nicklin Exp $ */
   2: 
   3: /*
   4:  * Author: Peter J. Nicklin
   5:  */
   6: 
   7: /*
   8:  * pathhead() removes tail of pathname and returns pathname. The tail is
   9:  * defined as that part of the pathname after the last separator.
  10:  */
  11: #include "null.h"
  12: #include "path.h"
  13: 
  14: char *
  15: pathhead(pathname)
  16:     register char *pathname;
  17: {
  18:     register char *ls;      /* last separator character */
  19:     register char *p;       /* pathname pointer */
  20: 
  21:     ls = NULL;
  22:     for (p = pathname; *p != '\0'; p++)
  23:         if (*p == _PSC)
  24:             ls = p;
  25:     if (ls != NULL) *ls = '\0';
  26:     return(pathname);
  27: }

Defined functions

pathhead defined in line 14; used 2 times
Last modified: 1985-07-03
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 515
Valid CSS Valid XHTML 1.0 Strict