summaryrefslogtreecommitdiffstats
path: root/usr.bin/mt
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>1999-03-02 06:27:59 +0000
committermjacob <mjacob@FreeBSD.org>1999-03-02 06:27:59 +0000
commiteb53d4fbfc10acebc225c09d10d4394c12d93076 (patch)
tree5aef6a1ad1cb56921574710234b9543221ea5f17 /usr.bin/mt
parent5149bf66662d331a001b00be7eda524726a4d8c4 (diff)
downloadFreeBSD-src-eb53d4fbfc10acebc225c09d10d4394c12d93076.zip
FreeBSD-src-eb53d4fbfc10acebc225c09d10d4394c12d93076.tar.gz
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.
Diffstat (limited to 'usr.bin/mt')
-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 c9364e8..71192ce 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;
}
/*
OpenPOWER on IntegriCloud