indent exits improperly; bug report 4.2BSD/ucb/197
[unix-history] / usr / src / usr.bin / indent / io.c
index 9e3df3c..986142d 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)io.c       5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)io.c       5.4 (Berkeley) %G%";
 #endif not lint
 
 /*-
 #endif not lint
 
 /*-
@@ -501,8 +501,11 @@ count_spaces(current, buffer)
     return (cur);
 };
 
     return (cur);
 };
 
+int    found_err;
 diag(level, msg, a, b)
 {
 diag(level, msg, a, b)
 {
+    if (level)
+       found_err = 1;
     if (output == stdout) {
        fprintf(stdout, "/**INDENT** %s@%d: ", level == 0 ? "Warning" : "Error", line_no);
        fprintf(stdout, msg, a, b);
     if (output == stdout) {
        fprintf(stdout, "/**INDENT** %s@%d: ", level == 0 ? "Warning" : "Error", line_no);
        fprintf(stdout, msg, a, b);