BSD 4_3_Tahoe release
[unix-history] / usr / src / ucb / indent / io.c
index 3a73747..e803783 100644 (file)
@@ -1,20 +1,27 @@
 /*
  * Copyright (c) 1980 Regents of the University of California.
 /*
  * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.  The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
+ * Copyright (c) 1976 Board of Trustees of the University of Illinois.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley and the University
+ * of Illinois, Urbana.  The name of either
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)io.c       5.3 (Berkeley) 9/8/85";
-#endif not lint
+static char sccsid[] = "@(#)io.c       5.7 (Berkeley) 6/29/88";
+#endif /* not lint */
 
 
-/*-
- *                       Copyright (C) 1976
- *                             by the
- *                       Board of Trustees
- *                             of the
- *                     University of Illinois
- *                      All rights reserved
+/*
  * FILE NAME:
  *     io.c
  * PURPOSE:
  * FILE NAME:
  *     io.c
  * PURPOSE:
@@ -65,7 +72,7 @@ static char sccsid[] = "@(#)io.c      5.3 (Berkeley) 9/8/85";
  *     initial coding  November 1976   D A Willcox of CAC
  *
  */\f
  *     initial coding  November 1976   D A Willcox of CAC
  *
  */\f
-#include "indent_globs.h";
+#include "indent_globs.h"
 
 
 
 
 
 
@@ -154,7 +161,7 @@ dump_line()
            }
            cur_col = pad_output(cur_col, target_col);
            for (p = s_code; p < e_code; p++)
            }
            cur_col = pad_output(cur_col, target_col);
            for (p = s_code; p < e_code; p++)
-               if (*p == 0200)
+               if (*p == (char)0200)
                    fprintf(output, "%d", target_col * 7);
                else
                    putc(*p, output);
                    fprintf(output, "%d", target_col * 7);
                else
                    putc(*p, output);
@@ -501,8 +508,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);