summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorwlemb <wlemb>2003-05-15 15:40:04 +0000
committerwlemb <wlemb>2003-05-15 15:40:04 +0000
commita1872d49e6bc8afffc8f22176cf05b6fc218e179 (patch)
tree98f1b35cfe96541913b69b4bb60117ba435edc74 /src/utils
parent0524bed6419dd40ed49306925fd377f06aa01efa (diff)
downloadgroff-a1872d49e6bc8afffc8f22176cf05b6fc218e179.tar.gz
* src/utils/pfbtops/pfbtops.c (get_text): Handle loop counter
correctly. * tmac/groff_mdoc.man: Slight improvements.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/pfbtops/pfbtops.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/utils/pfbtops/pfbtops.c b/src/utils/pfbtops/pfbtops.c
index 821d9019..094d9ddf 100644
--- a/src/utils/pfbtops/pfbtops.c
+++ b/src/utils/pfbtops/pfbtops.c
@@ -67,19 +67,27 @@ static void get_text(int n)
else if (c == '\\' && in_string) {
count++;
putchar(c);
+ if (n-- == 0)
+ break;
c = getchar();
/* don't split octal character representations */
if (c >= '0' && c <= '7') {
count++;
putchar(c);
+ if (n-- == 0)
+ break;
c = getchar();
if (c >= '0' && c <= '7') {
count++;
putchar(c);
+ if (n-- == 0)
+ break;
c = getchar();
if (c >= '0' && c <= '7') {
count++;
putchar(c);
+ if (n-- == 0)
+ break;
c = getchar();
}
}
@@ -88,9 +96,13 @@ static void get_text(int n)
if (c == EOF)
error("end of file in text packet");
else if (c == '\r') {
+ if (n-- == 0)
+ break;
c1 = getchar();
- if (c1 != '\n')
+ if (c1 != '\n') {
ungetc(c1, stdin);
+ n++;
+ }
c = '\n';
}
if (c == '\n') {
@@ -112,6 +124,8 @@ static void get_text(int n)
/* split at the next whitespace character */
while (c != ' ' && c != '\t' && c != '\f') {
putchar(c);
+ if (n-- == 0)
+ break;
c = getchar();
}
count = 0;