From: Jim Meyering <jim@meyering.net>
Date: Tue, 7 Nov 2000 15:35:15 +0000 (+0000)
Subject: (setusershell): Use rewind rather than
X-Git-Tag: FILEUTILS-4_0_32~17
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=3e391882aa38108e1227fa2734899aaeb6450800;p=gnulib.git

(setusershell): Use rewind rather than
fseek/fseeko, to avoid configuration hassles with fseeko.
Don't bother opening SHELLS_FILE if shellstream is NULL;
it's not necessary.
---

diff --git a/lib/getusershell.c b/lib/getusershell.c
index 75163ac26f..93d5e438ef 100644
--- a/lib/getusershell.c
+++ b/lib/getusershell.c
@@ -100,16 +100,8 @@ void
 setusershell ()
 {
   default_index = 0;
-  if (shellstream == NULL)
-    shellstream = fopen (SHELLS_FILE, "r");
-  else
-    {
-#ifdef HAVE_FSEEKO
-      fseeko (shellstream, 0, 0);
-#else
-      fseek (shellstream, 0L, 0);
-#endif
-    }
+  if (shellstream)
+    rewind (shellstream);
 }
 
 /* Close the shells file. */