/[bison]/bison/src/scan-gram.l
ViewVC logotype

Diff of /bison/src/scan-gram.l

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.54 by eggert, Tue Dec 31 02:26:51 2002 UTC revision 1.55 by eggert, Mon Feb 3 15:35:57 2003 UTC
# Line 1  Line 1 
1  /* Bison Grammar Scanner                             -*- C -*-  /* Bison Grammar Scanner                             -*- C -*-
2    
3     Copyright (C) 2002 Free Software Foundation, Inc.     Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4    
5     This file is part of Bison, the GNU Compiler Compiler.     This file is part of Bison, the GNU Compiler Compiler.
6    
# Line 682  adjust_location (location *loc, char con Line 682  adjust_location (location *loc, char con
682  static size_t  static size_t
683  no_cr_read (FILE *fp, char *buf, size_t size)  no_cr_read (FILE *fp, char *buf, size_t size)
684  {  {
685    size_t s = fread (buf, 1, size, fp);    size_t bytes_read = fread (buf, 1, size, fp);
686    if (s)    if (bytes_read)
687      {      {
688        char *w = memchr (buf, '\r', s);        char *w = memchr (buf, '\r', bytes_read);
689        if (w)        if (w)
690          {          {
691            char const *r = ++w;            char const *r = ++w;
692            char const *lim = buf + s;            char const *lim = buf + bytes_read;
693    
694            for (;;)            for (;;)
695              {              {
# Line 718  no_cr_read (FILE *fp, char *buf, size_t Line 718  no_cr_read (FILE *fp, char *buf, size_t
718          }          }
719      }      }
720    
721    return s;    return bytes_read;
722  }  }
723    
724    

Legend:
Removed from v.1.54  
changed lines
  Added in v.1.55

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26