diff --git a/usr.bin/ar/ar.c b/usr.bin/ar/ar.c index c53c1e44dcfa..73dab413df47 100644 --- a/usr.bin/ar/ar.c +++ b/usr.bin/ar/ar.c @@ -51,6 +51,7 @@ static const char sccsid[] = "@(#)ar.c 8.3 (Berkeley) 4/2/94"; #include #include #include +#include #include #include #include @@ -178,7 +179,7 @@ main(argc, argv) warnx("no position operand specified"); usage(); } - posname = rname(posarg); + posname = basename(posarg); } /* -d only valid with -Tv. */ if (options & AR_D && options & ~(AR_D|AR_TR|AR_V)) diff --git a/usr.bin/ar/archive.c b/usr.bin/ar/archive.c index 71606bd3efb6..32cdfa6a3470 100644 --- a/usr.bin/ar/archive.c +++ b/usr.bin/ar/archive.c @@ -36,6 +36,8 @@ #ifndef lint static const char sccsid[] = "@(#)archive.c 8.3 (Berkeley) 4/2/94"; +static const char rcsid[] = + "$FreeBSD$"; #endif /* not lint */ #include @@ -46,6 +48,7 @@ static const char sccsid[] = "@(#)archive.c 8.3 (Berkeley) 4/2/94"; #include #include #include +#include #include #include #include @@ -210,7 +213,7 @@ put_arobj(cfp, sb) * the last header read. */ if (sb) { - name = rname(cfp->rname); + name = basename(cfp->rname); (void)fstat(cfp->rfd, sb); /* diff --git a/usr.bin/ar/extern.h b/usr.bin/ar/extern.h index a6d7d71976f9..0efb771d988b 100644 --- a/usr.bin/ar/extern.h +++ b/usr.bin/ar/extern.h @@ -31,6 +31,7 @@ * SUCH DAMAGE. * * @(#)extern.h 8.3 (Berkeley) 4/2/94 + * $FreeBSD$ */ int append __P((char **)); @@ -45,7 +46,6 @@ int move __P((char **)); void orphans __P((char **argv)); int print __P((char **)); int replace __P((char **)); -char *rname __P((char *)); int tmp __P((void)); extern char *archive; diff --git a/usr.bin/ar/misc.c b/usr.bin/ar/misc.c index 026c45dcf598..d99d9564962e 100644 --- a/usr.bin/ar/misc.c +++ b/usr.bin/ar/misc.c @@ -36,6 +36,8 @@ #ifndef lint static const char sccsid[] = "@(#)misc.c 8.3 (Berkeley) 4/2/94"; +static const char rcsid[] = + "$FreeBSD$"; #endif /* not lint */ #include @@ -43,6 +45,7 @@ static const char sccsid[] = "@(#)misc.c 8.3 (Berkeley) 4/2/94"; #include #include #include +#include #include #include #include @@ -113,21 +116,12 @@ orphans(argv) warnx("%s: not found in archive", *argv); } -char * -rname(path) - char *path; -{ - char *ind; - - return ((ind = strrchr(path, '/')) ? ind + 1 : path); -} - int compare(dest) char *dest; { int maxname = (options & AR_TR) ? OLDARMAXNAME : MAXNAMLEN; - return (!strncmp(chdr.name, rname(dest), maxname)); + return (!strncmp(chdr.name, basename(dest), maxname)); } void