diff options
author | martijn <martijn@cvs.openbsd.org> | 2016-01-30 21:31:09 +0000 |
---|---|---|
committer | martijn <martijn@cvs.openbsd.org> | 2016-01-30 21:31:09 +0000 |
commit | e75adb95f77c8e7f6c983127c8c83227ec3a4e1d (patch) | |
tree | 16f07cf0f15ce227610b8e2f0771877b9e7f5de5 /usr.bin/vi/common | |
parent | e37fa6d215b2fdda463511b66a1c24c4b0f74933 (diff) |
replace tail with basename
OK tb@
Diffstat (limited to 'usr.bin/vi/common')
-rw-r--r-- | usr.bin/vi/common/log.c | 5 | ||||
-rw-r--r-- | usr.bin/vi/common/util.c | 18 |
2 files changed, 4 insertions, 19 deletions
diff --git a/usr.bin/vi/common/log.c b/usr.bin/vi/common/log.c index a423c55276d..662bcfd9b6f 100644 --- a/usr.bin/vi/common/log.c +++ b/usr.bin/vi/common/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.7 2016/01/06 22:28:52 millert Exp $ */ +/* $OpenBSD: log.c,v 1.8 2016/01/30 21:31:08 martijn Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -18,6 +18,7 @@ #include <bitstring.h> #include <errno.h> #include <fcntl.h> +#include <libgen.h> #include <limits.h> #include <stdio.h> #include <stdlib.h> @@ -635,7 +636,7 @@ log_err(SCR *sp, char *file, int line) { EXF *ep; - msgq(sp, M_SYSERR, "%s/%d: log put error", tail(file), line); + msgq(sp, M_SYSERR, "%s/%d: log put error", basename(file), line); ep = sp->ep; (void)ep->log->close(ep->log); if (!log_init(sp, ep)) diff --git a/usr.bin/vi/common/util.c b/usr.bin/vi/common/util.c index ffb3a27f7d8..df24d58c85a 100644 --- a/usr.bin/vi/common/util.c +++ b/usr.bin/vi/common/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.12 2015/12/07 20:39:19 mmcc Exp $ */ +/* $OpenBSD: util.c,v 1.13 2016/01/30 21:31:08 martijn Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -97,22 +97,6 @@ nonblank(SCR *sp, recno_t lno, size_t *cnop) } /* - * tail -- - * Return tail of a path. - * - * PUBLIC: char *tail(char *); - */ -char * -tail(char *path) -{ - char *p; - - if ((p = strrchr(path, '/')) == NULL) - return (path); - return (p + 1); -} - -/* * v_strdup -- * Strdup for wide character strings with an associated length. * |