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

Comparing ray/src/util/radcompare.c (file contents):
Revision 2.12 by greg, Fri Oct 19 22:15:30 2018 UTC vs.
Revision 2.13 by greg, Fri Oct 19 23:50:32 2018 UTC

# Line 141 | Line 141 | memerr:
141   static void
142   free_line(LINEBUF *bp)
143   {
144 <        bp->len = 0;
145 <        if (!bp->ptr) return;
146 <        free(bp->ptr);
147 <        bp->ptr = NULL;
144 >        if (bp->ptr) free(bp->ptr);
145 >        init_line(bp);
146   }
147  
148   /* Get type ID from name (or 0 if not found) */
# Line 514 | Line 512 | compare_text()
512                          if (*sskip2(l2buf.ptr,0))
513                                  break;          /* found other non-empty line */
514                  }
515 <                if (feof(f2in)) {
515 >                if (!l2buf.len) {               /* input 2 EOF? */
516                          if (report != REP_QUIET) {
517                                  fputs(f2name, stdout);
518                                  fputs(": unexpected end-of-file\n", stdout);
# Line 542 | Line 540 | compare_text()
540                          return(0);
541                  }
542          }
543 <                                                /* check for EOF on input 2 */
543 >        free_line(&l1buf);                      /* check for EOF on input 2 */
544          while (read_line(&l2buf, f2in)) {
545                  if (!*sskip2(l2buf.ptr,0))
546                          continue;
# Line 550 | Line 548 | compare_text()
548                          fputs(f1name, stdout);
549                          fputs(": unexpected end-of-file\n", stdout);
550                  }
551 <                free_line(&l1buf); free_line(&l2buf);
551 >                free_line(&l2buf);
552                  return(0);
553          }
554 <        free_line(&l1buf); free_line(&l2buf);
554 >        free_line(&l2buf);
555          return(good_RMS());                     /* final check for reals */
556   }
557  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines