139 |
|
char oname[1024]; |
140 |
|
LUENT *lep; |
141 |
|
STREAMOUT *sop; |
142 |
+ |
char *cp; |
143 |
|
|
144 |
|
if (ospec == NULL) { /* use stdout? */ |
145 |
|
if (!noopen & !using_stdout) { |
146 |
|
if (outfmt != 'a') |
147 |
|
SET_FILE_BINARY(stdout); |
148 |
|
if (header) { |
149 |
< |
sprintf(info, "NCOLS=%d\n", stdos.reclen); |
149 |
> |
cp = info; |
150 |
> |
if (yres > 0) { |
151 |
> |
sprintf(cp, "NROWS=%d\n", yres * |
152 |
> |
(xres + !xres) ); |
153 |
> |
while (*cp) ++cp; |
154 |
> |
} |
155 |
> |
sprintf(cp, "NCOLS=%d\n", stdos.reclen); |
156 |
|
printheader(stdout, info); |
157 |
|
} |
158 |
|
printresolu(stdout, xres, yres); |
204 |
|
#ifdef getc_unlocked |
205 |
|
flockfile(sop->ofp); /* avoid lock/unlock overhead */ |
206 |
|
#endif |
207 |
+ |
if (accumulate > 0) { /* global resolution */ |
208 |
+ |
sop->xr = xres; sop->yr = yres; |
209 |
+ |
} |
210 |
|
if (header) { |
211 |
< |
char *cp = info; |
211 |
> |
cp = info; |
212 |
|
if (ofl & OF_MODIFIER || sop->reclen == 1) { |
213 |
|
sprintf(cp, "MODIFIER=%s\n", mname); |
214 |
|
while (*cp) ++cp; |
217 |
|
sprintf(cp, "BIN=%d\n", bn); |
218 |
|
while (*cp) ++cp; |
219 |
|
} |
220 |
< |
sprintf(cp, "NCOLS=%d\n", sop->reclen); |
220 |
> |
if (sop->yr > 0) { |
221 |
> |
sprintf(cp, "NROWS=%d\n", sop->yr * |
222 |
> |
(sop->xr + !sop->xr) ); |
223 |
> |
while (*cp) ++cp; |
224 |
> |
} |
225 |
> |
sprintf(cp, "NCOLS=%d\nNCOMP=3\n", sop->reclen); |
226 |
|
printheader(sop->ofp, info); |
212 |
– |
} |
213 |
– |
if (accumulate > 0) { /* global resolution */ |
214 |
– |
sop->xr = xres; sop->yr = yres; |
227 |
|
} |
228 |
|
printresolu(sop->ofp, sop->xr, sop->yr); |
229 |
|
if (waitflush > 0) |