summaryrefslogtreecommitdiffstats
path: root/usr.bin/indent
diff options
context:
space:
mode:
authorbillf <billf@FreeBSD.org>1999-07-04 17:26:16 +0000
committerbillf <billf@FreeBSD.org>1999-07-04 17:26:16 +0000
commit4822432874e997891c75df8d30dcab4c52d1a9fa (patch)
tree6a75551fe39c6d09c4b5991bbb0a4f3d685835fe /usr.bin/indent
parent7c7c72da3801ba6f43e728ff5145b4988674abeb (diff)
downloadFreeBSD-src-4822432874e997891c75df8d30dcab4c52d1a9fa.zip
FreeBSD-src-4822432874e997891c75df8d30dcab4c52d1a9fa.tar.gz
Clean up some ambiguous nested if/elses.
Diffstat (limited to 'usr.bin/indent')
-rw-r--r--usr.bin/indent/indent.c8
-rw-r--r--usr.bin/indent/io.c8
2 files changed, 9 insertions, 7 deletions
diff --git a/usr.bin/indent/indent.c b/usr.bin/indent/indent.c
index ff5e420..c903d70 100644
--- a/usr.bin/indent/indent.c
+++ b/usr.bin/indent/indent.c
@@ -46,7 +46,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)indent.c 5.17 (Berkeley) 6/7/93";
#endif
static const char rcsid[] =
- "$Id: indent.c,v 1.2 1997/07/15 09:50:59 charnier Exp $";
+ "$Id: indent.c,v 1.3 1998/10/18 04:46:24 thepish Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -208,16 +208,16 @@ main(argc, argv)
else
set_option(argv[i]);
} /* end of for */
- if (input == 0) {
+ if (input == 0)
input = stdin;
- }
- if (output == 0)
+ if (output == 0) {
if (troff || input == stdin)
output = stdout;
else {
out_name = in_name;
bakcopy();
}
+ }
if (ps.com_ind <= 1)
ps.com_ind = 2; /* dont put normal comments before column 2 */
if (troff) {
diff --git a/usr.bin/indent/io.c b/usr.bin/indent/io.c
index d2222aa..11c9a8d 100644
--- a/usr.bin/indent/io.c
+++ b/usr.bin/indent/io.c
@@ -38,7 +38,7 @@
static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id$";
+ "$Id: io.c,v 1.3 1997/07/15 09:50:59 charnier Exp $";
#endif /* not lint */
#include <ctype.h>
@@ -84,7 +84,7 @@ dump_line()
else if (!inhibit_formatting) {
suppress_blanklines = 0;
ps.bl_line = false;
- if (prefix_blankline_requested && not_first_line)
+ if (prefix_blankline_requested && not_first_line) {
if (swallow_optional_blanklines) {
if (n_real_blanklines == 1)
n_real_blanklines = 0;
@@ -93,6 +93,7 @@ dump_line()
if (n_real_blanklines == 0)
n_real_blanklines = 1;
}
+ }
while (--n_real_blanklines >= 0)
putc('\n', output);
n_real_blanklines = 0;
@@ -238,11 +239,12 @@ dump_line()
e_com--;
cur_col = pad_output(cur_col, target);
if (!ps.box_com) {
- if (star_comment_cont && (com_st[1] != '*' || e_com <= com_st + 1))
+ if (star_comment_cont && (com_st[1] != '*' || e_com <= com_st + 1)) {
if (com_st[1] == ' ' && com_st[0] == ' ' && e_com > com_st + 1)
com_st[1] = '*';
else
fwrite(" * ", com_st[0] == '\t' ? 2 : com_st[0] == '*' ? 1 : 3, 1, output);
+ }
}
fwrite(com_st, e_com - com_st, 1, output);
ps.comment_delta = ps.n_comment_delta;
OpenPOWER on IntegriCloud