/[m4]/m4/m4/output.c
ViewVC logotype

Diff of /m4/m4/output.c

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

revision 1.9 by akim, Sat Oct 13 06:28:10 2001 UTC revision 1.10 by akim, Fri Oct 19 15:35:11 2001 UTC
# Line 284  make_room_for (int length) Line 284  make_room_for (int length)
284        selected_diversion->file = tmpfile ();        selected_diversion->file = tmpfile ();
285        if (selected_diversion->file == NULL)        if (selected_diversion->file == NULL)
286          M4ERROR ((EXIT_FAILURE, errno,          M4ERROR ((EXIT_FAILURE, errno,
287                    _("ERROR: Cannot create temporary file for diversion")));                    _("cannot create temporary file for diversion")));
288    
289        if (selected_diversion->used > 0)        if (selected_diversion->used > 0)
290          {          {
# Line 294  make_room_for (int length) Line 294  make_room_for (int length)
294                            selected_diversion->file);                            selected_diversion->file);
295            if (count != 1)            if (count != 1)
296              M4ERROR ((EXIT_FAILURE, errno,              M4ERROR ((EXIT_FAILURE, errno,
297                        _("ERROR: Cannot flush diversion to temporary file")));                        _("cannot flush diversion to temporary file")));
298          }          }
299    
300        /* Reclaim the buffer space for other diversions.  */        /* Reclaim the buffer space for other diversions.  */
# Line 372  output_text (const char *text, int lengt Line 372  output_text (const char *text, int lengt
372      {      {
373        count = fwrite (text, length, 1, output_file);        count = fwrite (text, length, 1, output_file);
374        if (count != 1)        if (count != 1)
375          M4ERROR ((EXIT_FAILURE, errno, _("ERROR: Copying inserted file")));          M4ERROR ((EXIT_FAILURE, errno, _("copying inserted file")));
376      }      }
377    else    else
378      {      {
# Line 575  m4_insert_file (FILE *file) Line 575  m4_insert_file (FILE *file)
575    while (length = read (fileno (file), buffer, COPY_BUFFER_SIZE),    while (length = read (fileno (file), buffer, COPY_BUFFER_SIZE),
576           length != 0)           length != 0)
577      if (length == (size_t) -1)      if (length == (size_t) -1)
578        M4ERROR ((EXIT_FAILURE, errno, _("ERROR: Reading inserted file")));        M4ERROR ((EXIT_FAILURE, errno, _("reading inserted file")));
579      else      else
580        output_text (buffer, length);        output_text (buffer, length);
581  }  }
# Line 665  m4_freeze_diversions (FILE *file) Line 665  m4_freeze_diversions (FILE *file)
665              {              {
666                fflush (diversion->file);                fflush (diversion->file);
667                if (fstat (fileno (diversion->file), &file_stat) < 0)                if (fstat (fileno (diversion->file), &file_stat) < 0)
668                  M4ERROR ((EXIT_FAILURE, errno, _("Cannot stat diversion")));                  M4ERROR ((EXIT_FAILURE, errno, _("cannot stat diversion")));
669                if (file_stat.st_size < 0                if (file_stat.st_size < 0
670                    || file_stat.st_size != (unsigned long) file_stat.st_size)                    || file_stat.st_size != (unsigned long) file_stat.st_size)
671                  M4ERROR ((EXIT_FAILURE, errno, _("Diversion too large")));                  M4ERROR ((EXIT_FAILURE, errno, _("diversion too large")));
672                fprintf (file, "D%d,%lu", divnum,                fprintf (file, "D%d,%lu", divnum,
673                         (unsigned long) file_stat.st_size);                         (unsigned long) file_stat.st_size);
674              }              }

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

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