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

Comparing ray/src/cal/rcalc.c (file contents):
Revision 1.33 by greg, Sat Mar 12 15:50:13 2022 UTC vs.
Revision 1.34 by greg, Sat Mar 12 18:14:45 2022 UTC

# Line 939 | Line 939 | advinp(void)                   /* move home to current position */
939   static void
940   passinp(void)                   /* pass beginning to current position */
941   {
942 <        if (!passive | (ipb.beg == NULL)) {
943 <                advinp();
942 >        if (!passive) {
943 >                advinp();               /* mistake to call us */
944                  return;
945          }
946 +        if (ipb.beg == NULL)            /* buffer overflowed a bit */
947 +                ipb.beg = ipb.end;
948          while (ipb.beg != ipb.pos) {    /* transfer buffer unaltered */
949                  putchar(*ipb.beg);
950                  if (++ipb.beg >= &inpbuf[INBSIZ])
# Line 954 | Line 956 | passinp(void)                  /* pass beginning to current position
956   static void
957   skipinp(void)                   /* rewind position and advance 1 */
958   {
959 <        if (ipb.beg == NULL)            /* full */
959 >        if (ipb.beg == NULL)            /* overflow - can't fully rewind */
960                  ipb.beg = ipb.end;
961          ipb.pos = ipb.beg;
962          ipb.chr = *ipb.pos;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines