1: /* $Header$ */
   2: 
   3: /*
   4:  * Author: Peter J. Nicklin
   5:  */
   6: 
   7: /*
   8:  * xorpath() strips pathname p1 from pathname p2 if p1 is a leading
   9:  * component of pathname p2. Returns p2.
  10:  */
  11: #include "path.h"
  12: 
  13: char *
  14: xorpath(p1, p2)
  15:     register char *p1;      /* subpathname */
  16:     register char *p2;      /* pathname */
  17: {
  18:     char *sp2;          /* start of pathname */
  19: 
  20:     sp2 = p2;
  21:     for (; *p1 == *p2; p1++, p2++)
  22:         if (*p1 == '\0')
  23:             break;
  24:     if (*p1 == '\0')
  25:         return((*p2 == _PSC) ? ++p2 : p2);
  26:     else
  27:         return(sp2);
  28: }

Defined functions

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