]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/file.c
Fix some build issues with the "core" component selection (rdar://47394086)
[thirdparty/cups.git] / cups / file.c
index 324abe26d428daebf8656e82dce0c23605303e33..e6e1f5b826f9d91d130891ab30c5036b45db3a75 100644 (file)
@@ -6,7 +6,7 @@
  * our own file functions allows us to provide transparent support of
  * different line endings, gzip'd print files, PPD files, etc.
  *
- * Copyright © 2007-2018 by Apple Inc.
+ * Copyright © 2007-2019 by Apple Inc.
  * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
  *
  * Licensed under Apache License v2.0.  See the file "LICENSE" for more
@@ -675,6 +675,12 @@ cupsFileGetChar(cups_file_t *fp)   /* I - CUPS file */
     return (-1);
   }
 
+  if (fp->eof)
+  {
+    DEBUG_puts("5cupsFileGetChar: End-of-file!");
+    return (-1);
+  }
+
  /*
   * If the input buffer is empty, try to read more data...
   */
@@ -1647,6 +1653,12 @@ cupsFileRead(cups_file_t *fp,            /* I - CUPS file */
   if (bytes == 0)
     return (0);
 
+  if (fp->eof)
+  {
+    DEBUG_puts("5cupsFileRead: End-of-file!");
+    return (-1);
+  }
+
  /*
   * Loop until all bytes are read...
   */