commit 984c2824e3569479bace65bdaf9e78a2eb36dd58
parent dfbafb68e22de866ab0a708862230acbac50910a
Author: Russ Cox <rsc@swtch.com>
Date: Wed, 13 Sep 2023 10:47:40 -0400
page: fix viewing of graphics
940f1fd6af broke page on non-PDF files.
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/cmd/page/page.c b/src/cmd/page/page.c
@@ -98,8 +98,9 @@ threadmain(int argc, char **argv)
Biobuf *b;
enum { Ninput = 16 };
uchar buf[Ninput+1];
- int readstdin;
+ int readstdin, haveppi;
+ haveppi = 0;
ARGBEGIN{
/* "temporary" debugging options */
case 'P':
@@ -127,6 +128,7 @@ threadmain(int argc, char **argv)
reverse = 1;
break;
case 'p':
+ haveppi = 1;
ppi = atoi(EARGF(usage()));
break;
case 'b':
@@ -223,7 +225,7 @@ threadmain(int argc, char **argv)
else if(strncmp((char*)buf, "x T ", 4) == 0)
doc = inittroff(b, argc, argv, buf, Ninput);
else {
- if(ppi != 100) {
+ if(haveppi) {
fprint(2, "page: you can't specify -p with graphic files\n");
wexits("-p and graphics");
}