summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2024-06-18 16:41:40 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2024-06-18 16:41:40 +0000
commit8b6236e55332d279631371599e4343612ea91d2c (patch)
tree03ab2de8a7cd9ff5eafb5b29cccbc0e6b54ef9e6 /bin
parentbc6df2a393d4672e2d5520ae62535fcef283dcc0 (diff)
Stop trying to deprecate "test -L" in favour of "test -h" (or vice versa).
It's hopeless because POSIX requires both since Issue 6 (2001). Both always worked on OpenBSD, no matter which base system shell was used. According to research done by jsg@, it seems likely that actually, "test -L" has precedence over "test -h" by about one year: v8 (Feb 1985) had -L, SunOS 3.0 (Feb 1986) had -h; but SVR4 (1989) already had both, so we are talking about 35 years of petrification. More details: https://marc.info/?l=openbsd-bugs&m=171867441927989 Resolving a question raised by Tim dot theCHASEs dot com on bugs@. OK deraadt@ millert@ jsg@ jmc@ and also works for Tim Chase.
Diffstat (limited to 'bin')
-rw-r--r--bin/test/test.113
-rw-r--r--bin/test/test.c4
2 files changed, 8 insertions, 9 deletions
diff --git a/bin/test/test.1 b/bin/test/test.1
index 2371acddad2..46c182b0fd5 100644
--- a/bin/test/test.1
+++ b/bin/test/test.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: test.1,v 1.34 2023/06/10 07:19:39 op Exp $
+.\" $OpenBSD: test.1,v 1.35 2024/06/18 16:41:39 schwarze Exp $
.\" $NetBSD: test.1,v 1.6 1995/03/21 07:04:03 cgd Exp $
.\"
.\" Copyright (c) 1991, 1993
@@ -33,7 +33,7 @@
.\"
.\" @(#)test.1 8.1 (Berkeley) 5/31/93
.\"
-.Dd $Mdocdate: June 10 2023 $
+.Dd $Mdocdate: June 18 2024 $
.Dt TEST 1
.Os
.Sh NAME
@@ -110,6 +110,8 @@ is set.
True if
.Ar file
exists and is a symbolic link.
+Identical to
+.Fl L .
.It Fl k Ar file
True if
.Ar file
@@ -118,11 +120,8 @@ exists and its sticky bit is set.
True if
.Ar file
exists and is a symbolic link.
-This operator is for compatibility purposes.
-Do not rely on its existence;
-use
-.Fl h
-instead.
+Identical to
+.Fl h .
.It Fl n Ar string
True if the length of
.Ar string
diff --git a/bin/test/test.c b/bin/test/test.c
index bb49356ec46..5756645574d 100644
--- a/bin/test/test.c
+++ b/bin/test/test.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: test.c,v 1.20 2022/10/11 13:40:38 jsg Exp $ */
+/* $OpenBSD: test.c,v 1.21 2024/06/18 16:41:39 schwarze Exp $ */
/* $NetBSD: test.c,v 1.15 1995/03/21 07:04:06 cgd Exp $ */
/*
@@ -110,7 +110,7 @@ struct t_op {
{"-t", FILTT, UNOP},
{"-z", STREZ, UNOP},
{"-n", STRNZ, UNOP},
- {"-h", FILSYM, UNOP}, /* for backwards compat */
+ {"-h", FILSYM, UNOP},
{"-O", FILUID, UNOP},
{"-G", FILGID, UNOP},
{"-L", FILSYM, UNOP},