aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/ul/ul.c
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2016-05-09 20:55:00 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2016-05-09 20:55:00 +0000
commitd819303ada1b0d749d46f701f5c1b0fdd98f2d58 (patch)
tree1ae57a7adcf1b550b0837de38f32f9f0aa0f6afc /usr.bin/ul/ul.c
parent8d791e5af1e6773782656648cdef47bdc35002fb (diff)
downloadsrc-d819303ada1b0d749d46f701f5c1b0fdd98f2d58.tar.gz
src-d819303ada1b0d749d46f701f5c1b0fdd98f2d58.zip
Notes
Diffstat (limited to 'usr.bin/ul/ul.c')
-rw-r--r--usr.bin/ul/ul.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/usr.bin/ul/ul.c b/usr.bin/ul/ul.c
index 7aecf6c1ec7e..cc76e3c6aeb3 100644
--- a/usr.bin/ul/ul.c
+++ b/usr.bin/ul/ul.c
@@ -113,9 +113,8 @@ main(int argc, char **argv)
termtype = getenv("TERM");
if (termtype == NULL || (argv[0][0] == 'c' && !isatty(1)))
termtype = "lpr";
- while ((c=getopt(argc, argv, "it:T:")) != -1)
- switch(c) {
-
+ while ((c = getopt(argc, argv, "it:T:")) != -1)
+ switch (c) {
case 't':
case 'T': /* for nroff compatibility */
termtype = optarg;
@@ -127,24 +126,21 @@ main(int argc, char **argv)
usage();
}
- switch(tgetent(termcap, termtype)) {
-
+ switch (tgetent(termcap, termtype)) {
case 1:
break;
-
default:
warnx("trouble reading termcap");
/* FALLTHROUGH */
-
case 0:
/* No such terminal type - assume dumb */
(void)strcpy(termcap, "dumb:os:col#80:cr=^M:sf=^J:am:");
break;
}
initcap();
- if ( (tgetflag("os") && ENTER_BOLD==NULL ) ||
- (tgetflag("ul") && ENTER_UNDERLINE==NULL && UNDER_CHAR==NULL))
- must_overstrike = 1;
+ if ((tgetflag("os") && ENTER_BOLD == NULL ) ||
+ (tgetflag("ul") && ENTER_UNDERLINE == NULL && UNDER_CHAR == NULL))
+ must_overstrike = 1;
initbuf();
if (optind == argc)
filter(stdin);
@@ -307,7 +303,7 @@ flushln(void)
int hadmodes = 0;
lastmode = NORMAL;
- for (i=0; i<maxcol; i++) {
+ for (i = 0; i < maxcol; i++) {
if (obuf[i].c_mode != lastmode) {
hadmodes++;
setnewmode(obuf[i].c_mode);