summaryrefslogtreecommitdiff
path: root/usr.bin/vi
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/vi')
-rw-r--r--usr.bin/vi/common/log.c5
-rw-r--r--usr.bin/vi/common/util.c18
-rw-r--r--usr.bin/vi/include/com_extern.h3
-rw-r--r--usr.bin/vi/vi/vs_refresh.c5
4 files changed, 8 insertions, 23 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.
*
diff --git a/usr.bin/vi/include/com_extern.h b/usr.bin/vi/include/com_extern.h
index 35fd59ae18f..181689eae32 100644
--- a/usr.bin/vi/include/com_extern.h
+++ b/usr.bin/vi/include/com_extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: com_extern.h,v 1.11 2016/01/20 08:43:27 bentley Exp $ */
+/* $OpenBSD: com_extern.h,v 1.12 2016/01/30 21:31:08 martijn Exp $ */
int cut(SCR *, CHAR_T *, MARK *, MARK *, int);
int cut_line(SCR *, recno_t, size_t, size_t, CB *);
@@ -105,7 +105,6 @@ int seq_save(SCR *, FILE *, char *, seq_t);
int e_memcmp(CHAR_T *, EVENT *, size_t);
void *binc(SCR *, void *, size_t *, size_t);
int nonblank(SCR *, recno_t, size_t *);
-char *tail(char *);
CHAR_T *v_strdup(SCR *, const CHAR_T *, size_t);
enum nresult nget_uslong(u_long *, const char *, char **, int);
enum nresult nget_slong(long *, const char *, char **, int);
diff --git a/usr.bin/vi/vi/vs_refresh.c b/usr.bin/vi/vi/vs_refresh.c
index 5f316a16fd3..a5f5496e0ae 100644
--- a/usr.bin/vi/vi/vs_refresh.c
+++ b/usr.bin/vi/vi/vs_refresh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vs_refresh.c,v 1.21 2016/01/06 22:29:38 millert Exp $ */
+/* $OpenBSD: vs_refresh.c,v 1.22 2016/01/30 21:31:08 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -17,6 +17,7 @@
#include <bitstring.h>
#include <ctype.h>
+#include <libgen.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
@@ -473,7 +474,7 @@ adjust: if (!O_ISSET(sp, O_LEFTRIGHT) &&
/* Sanity checking. */
if (CNO >= len && len != 0) {
msgq(sp, M_ERR, "Error: %s/%d: cno (%u) >= len (%u)",
- tail(__FILE__), __LINE__, CNO, len);
+ basename(__FILE__), __LINE__, CNO, len);
return (1);
}
#endif