BSD 4_3_Tahoe release
[unix-history] / usr / src / ucb / indent / indent.c
index 1650a60..8488851 100644 (file)
@@ -1,30 +1,34 @@
 /*
  * 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
 char copyright[] =
 "@(#) Copyright (c) 1980 Regents of the University of California.\n\
  */
 
 #ifndef lint
 char copyright[] =
 "@(#) Copyright (c) 1980 Regents of the University of California.\n\
+Copyright (c) 1976 Board of Trustees of the University of Illinois.\n\
  All rights reserved.\n";
  All rights reserved.\n";
-#endif not lint
+#endif /* not lint */
 
 #ifndef lint
 
 #ifndef lint
-static char sccsid[] = "@(#)indent.c   5.4 (Berkeley) 9/10/85";
-#endif not lint
+static char sccsid[] = "@(#)indent.c   5.8 (Berkeley) 6/29/88";
+#endif /* not lint */
 
 
-/*-
-  
-       Copyright (C) 1976
-               by the
-       Board of Trustees
-               of the
-       University of Illinois
-  
-       All rights reserved
-  
-  
+/*
 NAME:
 indent main program
   
 NAME:
 indent main program
   
@@ -44,8 +48,8 @@ changed, set the variable ps.ind_level.  If the indentation level for
 the following line should be changed, set the variable ps.i_l_follow.
 
 */
 the following line should be changed, set the variable ps.i_l_follow.
 
 */
-#include "indent_globs.h";
-#include "indent_codes.h";
+#include "indent_globs.h"
+#include "indent_codes.h"
 
 char       *in_name = "Standard Input";        /* will always point to name of
                                         * input file */
 
 char       *in_name = "Standard Input";        /* will always point to name of
                                         * input file */
@@ -57,6 +61,7 @@ main(argc, argv)
     int         argc;
     char      **argv;
 {
     int         argc;
     char      **argv;
 {
+    extern int found_err;      /* if any error occurred */
 
     int         dec_ind;       /* current indentation for declarations */
     int         di_stack[20];  /* a stack of structure indentation levels */
 
     int         dec_ind;       /* current indentation for declarations */
     int         di_stack[20];  /* a stack of structure indentation levels */
@@ -385,7 +390,7 @@ check_type:
                       (1.0 * ps.com_lines) / code_lines);
            }
            fflush(output);
                       (1.0 * ps.com_lines) / code_lines);
            }
            fflush(output);
-           exit(ps.tos <= 1);
+           exit(ps.tos > 1 || found_err);
        }
        if (
            (type_code != comment) &&
        }
        if (
            (type_code != comment) &&