ben         99/09/12 03:54:37

  Modified:    src/lib/apr/file_io/unix readwrite.c
  Log:
  Detect EOF correctly, fix a couple of minor warnings.
  
  Revision  Changes    Path
  1.8       +10 -4     apache-2.0/src/lib/apr/file_io/unix/readwrite.c
  
  Index: readwrite.c
  ===================================================================
  RCS file: /export/home/cvs/apache-2.0/src/lib/apr/file_io/unix/readwrite.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- readwrite.c       1999/09/12 10:52:14     1.7
  +++ readwrite.c       1999/09/12 10:54:37     1.8
  @@ -217,9 +217,14 @@
       ssize_t rv;
       
       if (thefile->buffered) {
  -        if ((*ch) = fgetc(thefile->filehand)) {
  -            return APR_SUCCESS;
  -        }
  +        int r;
  +
  +     r=fgetc(thefile->filehand);
  +     if(r != EOF)
  +         {
  +         *ch=(char)r;
  +         return APR_SUCCESS;
  +         }
           if (feof(thefile->filehand)) {
               return APR_EOF;
           }
  @@ -245,7 +250,6 @@
   ap_status_t ap_puts(ap_file_t *thefile, char *str)
   {
       ssize_t rv;
  -    int i = 0;    
       int len;
   
       if (thefile->buffered) {
  @@ -320,6 +324,7 @@
       return APR_SUCCESS; 
   }
   
  +#if 0 /* not currently used */
   static int printf_flush(ap_vformatter_buff_t *vbuff)
   {
       /* I would love to print this stuff out to the file, but I will
  @@ -327,6 +332,7 @@
        */
       return -1;
   }
  +#endif
   
   API_EXPORT(int) ap_fprintf(struct file_t *fptr, const char *format, ...)
   {
  
  
  

Reply via email to