From: Sami Kerola Date: Sat, 30 Apr 2011 11:06:27 +0000 (+0200) Subject: ul.c: warn user when command chooses term type X-Git-Tag: v2.20-rc1~248 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0200c80155358d57706d80895007f38b36e035ea;p=thirdparty%2Futil-linux.git ul.c: warn user when command chooses term type Happens usually when user specifies garbage as -t argument. Signed-off-by: Sami Kerola Signed-off-by: Karel Zak --- diff --git a/text-utils/ul.c b/text-utils/ul.c index 42a2ee279d..1cbacfc07c 100644 --- a/text-utils/ul.c +++ b/text-utils/ul.c @@ -147,7 +147,7 @@ usage(FILE *out) int main(int argc, char **argv) { - int c, ret; + int c, ret, tflag = 0; char *termtype; FILE *f; @@ -184,6 +184,7 @@ int main(int argc, char **argv) case 'T': /* for nroff compatibility */ termtype = optarg; + tflag = 1; break; case 'i': iflag = 1; @@ -209,7 +210,9 @@ int main(int argc, char **argv) /* fall through to ... */ case 0: - /* No such terminal type - assume dumb */ + if (tflag) + warnx(_("terminal `%s' is not known, defaulting to `dumb'"), + termtype); setupterm("dumb", STDOUT_FILENO, (int *)0); break; }