CAP Release 5.00 - PROBLEM REPORT: 0004 REPORT 0004 OS: any Revision: n/a Major local modifications: n/a Machine Type: n/a Date: 9/9/88 Reported by: Mark Wallen, Univ. of Californa at San Diego Priority: MEDIUM Problem: papif doesn't work right with filters Diagnosis: passalong in papif was incorrect. When crlf mapping was added to the passalong main loop, it was put in a way that broken things. Was also a missing pointer advance. Solution: Add a left and right bracket in the right place and add the pointer advance :-) The message from Mark Wallen follows with a patch: Subject: CAP 5.0 and Transcript Cc: madden@ucsd.edu There is a bug in the CAP 5.0 version of papif.c which causes it to fail when used with the transcript package and invoked via "lpr -p". The problem is a missing pair of {} in the routine passalong(); there is also a missing p++, see the diffs below. Mark Wallen Cognitive Science UCSD mrwallen@ucsd.edu ----------- %%START OF PATCH%% *** /tmp/,RCSt1018382 Fri Sep 9 10:54:57 1988 --- papif.c Fri Sep 9 10:34:06 1988 *************** *** 696,702 exit(lpd_ERRORS); if (precnt < wantcnt) exit(lpd_OK); ! while ((cnt = read(fileno(stdin), buf, sizeof(buf))) > 0) /* dangerous */ if (map_crtolf) { for (i = 0, p = buf; i < cnt; i++) --- 696,702 ----- exit(lpd_ERRORS); if (precnt < wantcnt) exit(lpd_OK); ! while ((cnt = read(fileno(stdin), buf, sizeof(buf))) > 0) { /* dangerous */ if (map_crtolf) { for (i = 0, p = buf; i < cnt; i++, p++) *************** *** 699,705 while ((cnt = read(fileno(stdin), buf, sizeof(buf))) > 0) /* dangerous */ if (map_crtolf) { ! for (i = 0, p = buf; i < cnt; i++) if (*p == '\r') *p = '\n'; } --- 699,705 ----- while ((cnt = read(fileno(stdin), buf, sizeof(buf))) > 0) { /* dangerous */ if (map_crtolf) { ! for (i = 0, p = buf; i < cnt; i++, p++) if (*p == '\r') *p = '\n'; } *************** *** 705,710 } if (write(fileno(stdout), buf, cnt) < 0) exit(lpd_ERRORS); exit(cnt < 0 ? lpd_ERRORS : lpd_OK); } --- 705,711 ----- } if (write(fileno(stdout), buf, cnt) < 0) exit(lpd_ERRORS); + } exit(cnt < 0 ? lpd_ERRORS : lpd_OK); } %%END OF PATCH%%