Mon Mar 4 20:37:32 2024 UTC (103d)
certctl(8): Pacify formal POSIX sh syntax.

According to POSIX 2018, the syntax between `then' and `elif' and
`fi' must be a _non-empty_ list of commands:

compound_list    : linebreak term
                 | linebreak term separator
                 ;
...
if_clause        : If compound_list Then compound_list else_part Fi
                 | If compound_list Then compound_list           Fi
                 ;
else_part        : Elif compound_list Then compound_list
                 | Elif compound_list Then compound_list else_part
                 | Else compound_list
                 ;

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_10_02

NetBSD's sh(1) currently doesn't enforce this and allows an empty
sequence of commands, but let's not rely on that nonstandard quirk.

Noted in PR 57997.


(riastradh)
diff -r1.6 -r1.7 src/usr.sbin/certctl/certctl.sh

cvs diff -r1.6 -r1.7 src/usr.sbin/certctl/certctl.sh (expand / switch to context diff)
--- src/usr.sbin/certctl/certctl.sh 2024/03/03 15:53:55 1.6
+++ src/usr.sbin/certctl/certctl.sh 2024/03/04 20:37:31 1.7
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-#	$NetBSD: certctl.sh,v 1.6 2024/03/03 15:53:55 riastradh Exp $
+#	$NetBSD: certctl.sh,v 1.7 2024/03/04 20:37:31 riastradh Exp $
 #
 # Copyright (c) 2023 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -440,6 +440,7 @@
 		return 1
 	elif [ ! -e "$certsdir" ]; then
 		# Directory doesn't exist at all.  Nothing to do!
+		:
 	elif [ ! -d "$certsdir" ]; then
 		error "certificates directory is not a directory"
 		return 1