🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1658

Bugs in gcc-2.3.3/cccp.c

#1658
From: h.b.furuseth
Date: Tue, 26 Jan 1993 02:19
85 lines
2575 bytes
A few bug fixes to cccp - 

Page 1: There was a jump into the block, past the initialization of
variable already_output.

Page 2: finclude() called trigraph_pcp without a terminating \0 in the
input string.

Page 3: A little memory leak.


*** cccp.c~	Mon Jan 25 21:35:51 1993
--- cccp.c	Mon Jan 25 21:33:57 1993
***************
*** 3159,3163 ****
     */
    for (kt = directive_table; kt->length > 0; kt++) {
!     if (kt->length == ident_length && !strncmp (kt->name, ident, ident_length)) {
        register U_CHAR *buf;
        register U_CHAR *limit;
--- 3159,3165 ----
     */
    for (kt = directive_table; kt->length > 0; kt++) {
!     if (kt->length == ident_length && !strncmp (kt->name, ident, ident_length))
!  old_linenum:
!  {
        register U_CHAR *buf;
        register U_CHAR *limit;
***************
*** 3170,3175 ****
        int keep_comments;
  
-     old_linenum:
- 
        limit = ip->buf + ip->length;
        unterminated = 0;
--- 3172,3175 ----



*** cccp.c~	Mon Jan 25 21:35:51 1993
--- cccp.c	Mon Jan 25 21:33:57 1993
***************
*** 4115,4118 ****
--- 4115,4126 ----
    }
  
+   if ((fp->length > 0 && fp->buf[fp->length - 1] != '\n')
+       /* Backslash-newline at end is not good enough.  */
+       || (fp->length > 1 && fp->buf[fp->length - 2] == '\\')) {
+     fp->buf[fp->length++] = '\n';
+     missing_newline = 1;
+   }
+   fp->buf[fp->length] = '\0';
+ 
    /* Close descriptor now, so nesting does not use lots of descriptors.  */
    close (f);
***************
*** 4127,4138 ****
      trigraph_pcp (fp);
  
-   if ((fp->length > 0 && fp->buf[fp->length - 1] != '\n')
-       /* Backslash-newline at end is not good enough.  */
-       || (fp->length > 1 && fp->buf[fp->length - 2] == '\\')) {
-     fp->buf[fp->length++] = '\n';
-     missing_newline = 1;
-   }
-   fp->buf[fp->length] = '\0';
- 
    output_line_command (fp, op, 0, enter_file);
    rescan (op, 0);
--- 4135,4138 ----



*** cccp.c~	Mon Jan 25 21:35:51 1993
--- cccp.c	Mon Jan 25 21:33:57 1993
***************
*** 4578,4581 ****
--- 4578,4582 ----
      }
    }
+   free (line_command);
  }
  
Technical Details
Message-ID: <9301252049.AAdurin12217@durin.uio.no>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!usit.uio.NO!h.b.furuseth

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!usit.uio.NO!h.b.furuseth
From: h.b.furuseth@usit.uio.NO
Newsgroups: gnu.gcc.bug
Subject: Bugs in gcc-2.3.3/cccp.c
Date: 25 Jan 1993 21:19:01 -0500
Organization: GNUs Not Usenet
Lines: 86
Sender: daemon@cis.ohio-state.edu
Approved: bug-gcc@prep.ai.mit.edu
Distribution: gnu
Message-ID: <9301252049.AAdurin12217@durin.uio.no>