From: schwarze Date: Tue, 18 Jun 2024 16:41:39 +0000 (+0000) Subject: Stop trying to deprecate "test -L" in favour of "test -h" (or vice versa). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1245b84dd8b155eea7f3aeffc9acb78e7116673b;p=openbsd 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. --- 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},