🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Raymond L. Toy Tue, 29 Sep 1992 07:27
indent doesn't print messages to stderr
#967
Author: 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)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads