aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/jpg
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-09-15 17:09:40 +0000
committerrsc <devnull@localhost>2005-09-15 17:09:40 +0000
commitd1e25ee94ec984b7557a4d4a178faee0b03f18ee (patch)
tree12b423e1c6f57ffa026a5f668103aa4d2a7ebb98 /src/cmd/jpg
parent68e139f29357d530eb0b0eaf18a437f2dd77e5c9 (diff)
downloadplan9port-d1e25ee94ec984b7557a4d4a178faee0b03f18ee.tar.gz
plan9port-d1e25ee94ec984b7557a4d4a178faee0b03f18ee.tar.bz2
plan9port-d1e25ee94ec984b7557a4d4a178faee0b03f18ee.zip
Do not revert to CMAP for second file. (Rob Pike).
Diffstat (limited to 'src/cmd/jpg')
-rw-r--r--src/cmd/jpg/jpg.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/cmd/jpg/jpg.c b/src/cmd/jpg/jpg.c
index f61172a5..82dba4d7 100644
--- a/src/cmd/jpg/jpg.c
+++ b/src/cmd/jpg/jpg.c
@@ -268,16 +268,18 @@ rpt: array = Breadjpg(&b, colorspace);
c = nil;
if(jflag)
goto Return;
- if(!dflag && !inited){
- if(initdraw(0, 0, 0) < 0){
- fprint(2, "jpg: initdraw failed: %r\n");
- return "initdraw";
+ if(!dflag){
+ if(!inited){
+ if(initdraw(0, 0, 0) < 0){
+ fprint(2, "jpg: initdraw failed: %r\n");
+ return "initdraw";
+ }
+ if(Fflag == 0)
+ einit(Ekeyboard|Emouse);
+ inited++;
}
- if(Fflag == 0)
- einit(Ekeyboard|Emouse);
if(defaultcolor && screen->depth>8 && outchan==CMAP8)
outchan = RGB24;
- inited++;
}
if(outchan == CMAP8)
c = torgbv(r, !eflag);