I noticed in commit v9.12-271-g2d02d0821 that stdio--.h
was removed because fopen() was, but sc_require_stdio_safer
only checked for freopen().

* cfg.mk (sc_require_stdio_safer): Check for both
fopen_safer and freopen_safer.
---
 cfg.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index 0f9ae659c..80e0fdce3 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -588,11 +588,11 @@ sc_prohibit_short_facl_mode_spec:
        halt='setfacl mode string length < 3; extend with hyphen(s)'    \
          $(_sc_search_regexp)
 
-# Ensure that "stdio--.h" is used where appropriate.
+# Require "stdio--.h" for the fopen-safer and freopen-safer modules.
 sc_require_stdio_safer:
        @if $(VC_LIST_EXCEPT) | grep -l '\.[ch]$$' > /dev/null; then    \
-         files=$$(grep -El '$(begword)freopen ?\(' $$($(VC_LIST_EXCEPT)\
-             | grep '\.[ch]$$'));                                      \
+         files=$$(grep -El '$(begword)f(re)?open *\('                  \
+             $$($(VC_LIST_EXCEPT) | grep '\.[ch]$$'));                 \
          test -n "$$files" && grep -LE 'include "stdio--.h"' $$files   \
              | grep . &&                                               \
          { echo '$(ME): the above files should use "stdio--.h"'        \
-- 
2.56.0


Reply via email to