]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - libio/iofgets.c
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / libio / iofgets.c
index b15b59d3bf6fd4a0d9f216cc23e6d7d502c57496..d57e42c0911acf0717c4a952e8c66cad34e633ec 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -13,7 +13,7 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.
+   <https://www.gnu.org/licenses/>.
 
    As a special exception, if you link the code in this file with
    files compiled with a GNU compiler to produce an executable,
@@ -48,20 +48,19 @@ _IO_fgets (char *buf, int n, FILE *fp)
   /* This is very tricky since a file descriptor may be in the
      non-blocking mode. The error flag doesn't mean much in this
      case. We return an error only when there is a new error. */
-  old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
-  fp->_IO_file_flags &= ~_IO_ERR_SEEN;
+  old_error = fp->_flags & _IO_ERR_SEEN;
+  fp->_flags &= ~_IO_ERR_SEEN;
   count = _IO_getline (fp, buf, n - 1, '\n', 1);
   /* If we read in some bytes and errno is EAGAIN, that error will
      be reported for next read. */
-  if (count == 0 || ((fp->_IO_file_flags & _IO_ERR_SEEN)
-                    && errno != EAGAIN))
+  if (count == 0 || ((fp->_flags & _IO_ERR_SEEN) && errno != EAGAIN))
     result = NULL;
   else
     {
       buf[count] = '\0';
       result = buf;
     }
-  fp->_IO_file_flags |= old_error;
+  fp->_flags |= old_error;
   _IO_release_lock (fp);
   return result;
 }