summaryrefslogtreecommitdiff
path: root/src/pr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pr.c')
-rw-r--r--src/pr.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/pr.c b/src/pr.c
index 77d4c8ae7..14c9d22a1 100644
--- a/src/pr.c
+++ b/src/pr.c
@@ -2726,7 +2726,17 @@ char_to_clump (char c)
*s = c;
}
- input_position += width;
+ /* Too many backspaces must put us in position 0 -- never negative. */
+ if (width < 0 && input_position == 0)
+ {
+ chars = 0;
+ input_position = 0;
+ }
+ else if (width < 0 && input_position <= -width)
+ input_position = 0;
+ else
+ input_position += width;
+
return chars;
}