ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/rcollate.c
(Generate patch)

Comparing ray/src/util/rcollate.c (file contents):
Revision 2.18 by greg, Fri Aug 1 18:21:04 2014 UTC vs.
Revision 2.19 by greg, Thu Sep 18 00:12:42 2014 UTC

# Line 381 | Line 381 | do_resize(FILE *fp)
381          int     columns2go = no_columns;
382          char    word[256];
383                                                  /* sanity checks */
384 <        if (comp_size)
385 <                return(output_stream(fp));      /* binary data -- just copy */
384 >        if (comp_size || (no_columns == ni_columns) & (no_rows == ni_rows))
385 >                return(output_stream(fp));      /* no-op -- just copy */
386          if (no_columns <= 0) {
387                  fprintf(stderr, "Missing -oc specification\n");
388                  return(0);
# Line 572 | Line 572 | main(int argc, char *argv[])
572                  SET_FILE_BINARY(stdout);
573          }
574                                                  /* check for no-op */
575 <        if (!transpose & !i_header & !o_header && (comp_size ||
576 <                        (no_columns == ni_columns) & (no_rows == ni_rows))) {
575 >        if (!transpose & (i_header == o_header) &&
576 >                        (no_columns == ni_columns) & (no_rows == ni_rows)) {
577                  if (warnings)
578                          fprintf(stderr, "%s: no-op -- copying input verbatim\n",
579                                  argv[0]);
# Line 603 | Line 603 | main(int argc, char *argv[])
603                  fputc('\n', stdout);            /* finish new header */
604          }
605          if (transpose) {                        /* transposing rows & columns? */
606 <                MEMLOAD myMem;                  /* need to load into memory */
606 >                MEMLOAD myMem;                  /* need to map into memory */
607                  if (a == argc-1) {
608                          if (load_file(&myMem, stdin) <= 0) {
609                                  fprintf(stderr, "%s: error loading file into memory\n",
# Line 618 | Line 618 | main(int argc, char *argv[])
618                  if (!do_transpose(&myMem))
619                          return(1);
620                  /* free_load(&myMem);   about to exit, so don't bother */
621        } else if (comp_size || (no_columns==ni_columns) & (no_rows==ni_rows)) {
622                if (!output_stream(stdin))      /* just changed header */
623                        return(1);
621          } else if (!do_resize(stdin))           /* reshaping input */
622                  return(1);
623          return(0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines