summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorwlemb <wlemb>2001-05-16 11:07:51 +0000
committerwlemb <wlemb>2001-05-16 11:07:51 +0000
commit59b5860e276a37567b7c0b1f6a6acadb8b9ab4c6 (patch)
tree08c4ce5ae83c1adf952e58ed745bf32d889b6af8 /src
parent73b696c337bcaaf324fba6d02ff4081adeab0a10 (diff)
downloadgroff-59b5860e276a37567b7c0b1f6a6acadb8b9ab4c6.tar.gz
* contrib/mm/m.tmac (TH): Fix incorrect error message.
* src/roff/troff/input.cc (read_size): Emit warning if value becomes less than or equal zero; set it to 1 then. * src/roff/troff/node.h (node::node): Initialize `last'.
Diffstat (limited to 'src')
-rw-r--r--src/roff/troff/input.cc5
-rw-r--r--src/roff/troff/node.h4
-rw-r--r--src/roff/troff/token.h2
3 files changed, 8 insertions, 3 deletions
diff --git a/src/roff/troff/input.cc b/src/roff/troff/input.cc
index ee7833b4..366d77fd 100644
--- a/src/roff/troff/input.cc
+++ b/src/roff/troff/input.cc
@@ -4006,6 +4006,11 @@ static int read_size(int *x)
default:
assert(0);
}
+ if (*x <= 0) {
+ warning(WARN_RANGE,
+ "\\s request results in non-positive point size; set to 1");
+ *x = 1;
+ }
return 1;
}
else {
diff --git a/src/roff/troff/node.h b/src/roff/troff/node.h
index 48140c74..a58afed1 100644
--- a/src/roff/troff/node.h
+++ b/src/roff/troff/node.h
@@ -106,11 +106,11 @@ struct node {
virtual const char *type() = 0;
};
-inline node::node() : next(0)
+inline node::node() : next(0), last(0)
{
}
-inline node::node(node *n) : next(n)
+inline node::node(node *n) : next(n), last(0)
{
}
diff --git a/src/roff/troff/token.h b/src/roff/troff/token.h
index 40283adb..b87a0b18 100644
--- a/src/roff/troff/token.h
+++ b/src/roff/troff/token.h
@@ -72,7 +72,7 @@ public:
int space(); // is the current token a space?
int stretchable_space(); // is the current token a stretchable space?
int white_space(); // is the current token space or tab?
- int special(); // is the current token a special character?
+ int special(); // is the current token a special character?
int newline(); // is the current token a newline?
int tab(); // is the current token a tab?
int leader();