(setusershell): Use rewind rather than
authorJim Meyering <jim@meyering.net>
Tue, 7 Nov 2000 15:35:15 +0000 (15:35 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 7 Nov 2000 15:35:15 +0000 (15:35 +0000)
fseek/fseeko, to avoid configuration hassles with fseeko.
Don't bother opening SHELLS_FILE if shellstream is NULL;
it's not necessary.

lib/getusershell.c

index 75163ac..93d5e43 100644 (file)
@@ -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. */