* lib/getusershell.c: Include stdio.h.
[!GNULIB_FOPEN_SAFER]: Don’t include stdio--.h.
* modules/getusershell (Depends-on): Depend on fopen, not fopen-safer.
---
 ChangeLog            | 5 +++++
 lib/getusershell.c   | 6 +++++-
 modules/getusershell | 2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1e62e9acbf..87454b1325 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2024-11-06  Paul Eggert  <egg...@cs.ucla.edu>
 
+       getusershell: don’t depend on fopen-safer
+       * lib/getusershell.c: Include stdio.h.
+       [!GNULIB_FOPEN_SAFER]: Don’t include stdio--.h.
+       * modules/getusershell (Depends-on): Depend on fopen, not fopen-safer.
+
        savewd: don’t depend on fcntl-safer
        * lib/savewd.c: Don’t include fcntl-safer.
        [GNULIB_FCNTL_SAFER]: Include fcntl--.h.
diff --git a/lib/getusershell.c b/lib/getusershell.c
index 817318327b..e86a732dff 100644
--- a/lib/getusershell.c
+++ b/lib/getusershell.c
@@ -33,14 +33,18 @@
 # endif
 #endif
 
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
 
-#include "stdio--.h"
 #include "filename.h"
 #include "xalloc.h"
 
+#if GNULIB_FOPEN_SAFER
+# include "stdio--.h"
+#endif
+
 #if ! defined ADDITIONAL_DEFAULT_SHELLS && defined __MSDOS__
 # define ADDITIONAL_DEFAULT_SHELLS \
   "c:/dos/command.com", "c:/windows/command.com", "c:/command.com",
diff --git a/modules/getusershell b/modules/getusershell
index a4a40852ac..c9ef576e25 100644
--- a/modules/getusershell
+++ b/modules/getusershell
@@ -8,7 +8,7 @@ m4/getusershell.m4
 Depends-on:
 unistd
 extensions
-fopen-safer          [test $HAVE_GETUSERSHELL = 0 || test 
$REPLACE_GETUSERSHELL = 1]
+fopen                [test $HAVE_GETUSERSHELL = 0 || test 
$REPLACE_GETUSERSHELL = 1]
 getline              [test $HAVE_GETUSERSHELL = 0 || test 
$REPLACE_GETUSERSHELL = 1]
 filename             [test $HAVE_GETUSERSHELL = 0 || test 
$REPLACE_GETUSERSHELL = 1]
 xalloc               [test $HAVE_GETUSERSHELL = 0 || test 
$REPLACE_GETUSERSHELL = 1]
-- 
2.43.0


Reply via email to