aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/mt/mt.c
diff options
context:
space:
mode:
authorMatt Jacob <mjacob@FreeBSD.org>1999-03-02 06:27:59 +0000
committerMatt Jacob <mjacob@FreeBSD.org>1999-03-02 06:27:59 +0000
commitc4e8e42c9872eda90b981e382287fb188d9160cf (patch)
tree0975b6208b0eef98f7b3122ba31444f831e2852e /usr.bin/mt/mt.c
parente5f251d2d3aaeb5e6b5572e7860c305deb8dbc9d (diff)
downloadsrc-c4e8e42c9872eda90b981e382287fb188d9160cf.tar.gz
src-c4e8e42c9872eda90b981e382287fb188d9160cf.zip
Print actual density code as well as string for density- I dunno about others,
but I sure remember 0x15 easier than 'ECMA 17'. Also handle density codes 0 (default) and 0x7f ('same') as special cases.
Notes
Notes: svn path=/head/; revision=44397
Diffstat (limited to 'usr.bin/mt/mt.c')
-rw-r--r--usr.bin/mt/mt.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/usr.bin/mt/mt.c b/usr.bin/mt/mt.c
index c9364e821357..71192ce0ed74 100644
--- a/usr.bin/mt/mt.c
+++ b/usr.bin/mt/mt.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)mt.c 8.2 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
- "$Id: mt.c,v 1.20 1998/12/22 17:28:25 mjacob Exp $";
+ "$Id: mt.c,v 1.21 1999/02/05 02:46:21 mjacob Exp $";
#endif /* not lint */
/*
@@ -511,14 +511,19 @@ denstostring(int d)
static char buf[20];
struct densities *sd;
+ /* densities 0 and 0x7f are handled as special cases */
+ if (d == 0)
+ return "default";
+ if (d == 0x7f)
+ return "same";
for (sd = dens; sd->dens; sd++)
if (sd->dens == d)
break;
- if (sd->dens == 0) {
+ if (sd->dens == 0)
sprintf(buf, "0x%02x", d);
- return buf;
- } else
- return sd->name;
+ else
+ sprintf(buf, "0x%02x:%s", d, sd->name);
+ return buf;
}
/*