summaryrefslogtreecommitdiffstats
path: root/text-utils/ul.c
diff options
context:
space:
mode:
authorSami Kerola2011-04-30 13:06:27 +0200
committerKarel Zak2011-05-17 15:58:05 +0200
commit0200c80155358d57706d80895007f38b36e035ea (patch)
treef2c47514625b58b7a5be0f3e60565ff5507139c1 /text-utils/ul.c
parentul.c: escape handling refactored (diff)
downloadkernel-qcow2-util-linux-0200c80155358d57706d80895007f38b36e035ea.tar.gz
kernel-qcow2-util-linux-0200c80155358d57706d80895007f38b36e035ea.tar.xz
kernel-qcow2-util-linux-0200c80155358d57706d80895007f38b36e035ea.zip
ul.c: warn user when command chooses term type
Happens usually when user specifies garbage as -t argument. Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'text-utils/ul.c')
-rw-r--r--text-utils/ul.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/text-utils/ul.c b/text-utils/ul.c
index 42a2ee279..1cbacfc07 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;
}