🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #967

indent doesn't print messages to stderr

#967
From: Raymond L. Toy
Date: Tue, 29 Sep 1992 07:27
58 lines
2043 bytes
Here's a simple little patch for indent 1.6 that fixes an annoying
problem for me.  When reading from stdin, indent sends messages and
warnings to stdout along with the resulting indented code.  Thus,
unless I scan through the result, I won't know if there was an error/warning
or not.  This is pretty annoying, especially if you are indenting
someone else's code that contains anachronistic constructs accepted by
the compiler like "=-" for "-=".

Anyway, this patch makes the error messages always go to stderr and
stdout.

Ray

----------
Ray -----> toy@soho.crd.ge.com
Toy -----> KWC407, x6270



*** indent-1.6/io.c	Fri Aug 14 19:09:17 1992
--- indent-1.6a/io.c	Tue Sep 29 10:55:04 1992
***************
*** 502,509 ****
--- 502,511 ----
  
        if (ch != EOF)
  	{
+ 	  int offset = p - stdinptr.data;
  	  size += (2 * BUFSIZ);
  	  stdinptr.data = xrealloc (stdinptr.data, size);
+ 	  p = stdinptr.data + offset;
  	}
      }
    while (ch != EOF);
***************
*** 752,763 ****
        fprintf (stdout, msg, a, b);
        fprintf (stdout, " */\n");
      }
!   else
!     {
!       fprintf (stderr, "%s: %d: ", in_name, line_no);
!       fprintf (stderr, msg, a, b);
!       fprintf (stderr, "\n");
!     }
  }
  
  writefdef (f, nm)
--- 754,762 ----
        fprintf (stdout, msg, a, b);
        fprintf (stdout, " */\n");
      }
!   fprintf (stderr, "%s: %d: ", in_name, line_no);
!   fprintf (stderr, msg, a, b);
!   fprintf (stderr, "\n");
  }
  
  writefdef (f, nm)
Technical Details
Message-ID: <9209291527.AA14167@alydar.crd.Ge.Com>
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!ames!elroy.jpl.nasa.gov!usc!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!alydar.CRd.ge.COM!toy

Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!ames!elroy.jpl.nasa.gov!usc!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!alydar.CRd.ge.COM!toy
From: toy@alydar.CRd.ge.COM (Raymond L. Toy)
Subject: indent doesn't print messages to stderr
Message-ID: <9209291527.AA14167@alydar.crd.Ge.Com>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Tue, 29 Sep 1992 07:27:41 GMT
Approved: bug-gnu-utils@prep.ai.mit.edu
Lines: 60