Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ll-xn!husc6!cmcl2!beta!hgm From: hgm@beta.UUCP (Harry McGavran) Newsgroups: comp.os.minix Subject: Diffs for pr adjacent blank line problem Message-ID: <5271@beta.UUCP> Date: Tue, 12-May-87 12:41:28 EDT Article-I.D.: beta.5271 Posted: Tue May 12 12:41:28 1987 Date-Received: Fri, 15-May-87 02:16:20 EDT Organization: Los Alamos Natl Lab, Los Alamos, N.M. Lines: 41 "pr" doesn't handle adjacent lines containing only '\n'. They aren't included in the pagelength accumulation, so pages containing them end up longer. Also the "-n" option fails on these lines. Here are the context diffs for one possible fix for that. As usual, I claim these changes aren't suitable for anything. ------------------------------Cut here-------------------------------- *** pr.c Tue May 12 10:46:51 1987 --- pr_c.new Tue May 12 10:46:46 1987 *************** *** 254,262 **** while (lines && c != EOF) { if (number) printf("%d\t", linenr++); ! do { putchar(c); ! } while ((c = getc(filep)) != '\n' && c != EOF); putchar('\n'); lines--; c = getc(filep); --- 254,263 ---- while (lines && c != EOF) { if (number) printf("%d\t", linenr++); ! while (c != '\n' && c != EOF) { putchar(c); ! c = getc(filep); ! } putchar('\n'); lines--; c = getc(filep); --------------------------------Cut here----------------------------- Harry McGavran hgm@LANL.GOV Los Alamos National Laboratory MS-B294, Group C-8 Los Alamos, New Mexico 87545 505/667-4050