--- ray/src/px/ximage.c 1989/04/18 11:07:12 1.4 +++ ray/src/px/ximage.c 1989/05/23 10:46:32 1.7 @@ -137,9 +137,7 @@ char *argv[]; sprintf(errmsg, "can't open file \"%s\"", fname); quiterr(errmsg); } - } else - goto userr; - + } /* get header */ getheader(fin, headline); /* get picture dimensions */ @@ -347,7 +345,7 @@ redraw(x, y, w, h) /* redraw section of window */ int x, y; int w, h; { - if (map_rcolors(ourras) == NULL) { + if (ourras->ncolors && map_rcolors(ourras) == NULL) { fprintf(stderr, "%s: cannot allocate colors\n", progname); return(-1); } @@ -419,10 +417,8 @@ XKeyEvent *ekey; if (avgbox(cval) == -1) return(-1); n = log(.5/bright(cval))/.69315 - scale; /* truncate */ - if (n == 0) { - XFeep(0); + if (n == 0) return(0); - } scale_rcolors(ourras, pow(2.0, (double)n)); scale += n; sprintf(buf, "%+d", scale); @@ -433,6 +429,7 @@ XKeyEvent *ekey; getras(); /* fall through */ case CTRL(R): /* redraw */ + case CTRL(L): XClear(wind); return(redraw(0, 0, width, height)); case ' ': /* clear */