Annotation of 43BSD/contrib/mkmf/src/pathhead.c, revision 1.1.1.1

1.1       root        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: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.