summaryrefslogtreecommitdiffstats
path: root/contrib/groff/src/roff/troff/symbol.cc
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2002-10-11 08:52:17 +0000
committerru <ru@FreeBSD.org>2002-10-11 08:52:17 +0000
commit49694bd3ad767a896dc092289a2b59c780a3ba02 (patch)
tree3ab4ff2268c18cde66cbf296cc57caf69acdea70 /contrib/groff/src/roff/troff/symbol.cc
parentb6731a278e1260409b42bb486cc7592dd1a19203 (diff)
parent127e61728bacf1fb90edd8be1b0c406619e78bc8 (diff)
downloadFreeBSD-src-49694bd3ad767a896dc092289a2b59c780a3ba02.zip
FreeBSD-src-49694bd3ad767a896dc092289a2b59c780a3ba02.tar.gz
This commit was generated by cvs2svn to compensate for changes in r104862,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/groff/src/roff/troff/symbol.cc')
-rw-r--r--contrib/groff/src/roff/troff/symbol.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/contrib/groff/src/roff/troff/symbol.cc b/contrib/groff/src/roff/troff/symbol.cc
index ce09e39..09f4c98 100644
--- a/contrib/groff/src/roff/troff/symbol.cc
+++ b/contrib/groff/src/roff/troff/symbol.cc
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2002 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -29,6 +29,7 @@ char *symbol::block = 0;
int symbol::block_size = 0;
const symbol NULL_SYMBOL;
+const symbol EMPTY_SYMBOL("");
#ifdef BLOCK_SIZE
#undef BLOCK_SIZE
@@ -38,9 +39,9 @@ const int BLOCK_SIZE = 1024;
// the table will increase in size as necessary
// the size will be chosen from the following array
// add some more if you want
-// I think it unlikely that we'll need more than a million symbols
static const unsigned int table_sizes[] = {
-101, 503, 1009, 2003, 3001, 4001, 5003, 10007, 20011, 40009, 80021, 160001, 500009, 1000003, 0
+ 101, 503, 1009, 2003, 3001, 4001, 5003, 10007, 20011, 40009, 80021,
+ 160001, 500009, 1000003, 1500007, 2000003, 0
};
const double FULL_MAX = 0.3; // don't let the table get more than this full
@@ -73,10 +74,14 @@ inline void unused(void *) { }
symbol::symbol(const char *p, int how)
{
- if (p == 0 || *p == 0) {
+ if (p == 0) {
s = 0;
return;
}
+ if (*p == 0) {
+ s = "";
+ return;
+ }
if (table == 0) {
table_size = table_sizes[0];
table = (const char **)new char*[table_size];
@@ -147,4 +152,3 @@ symbol concat(symbol s1, symbol s2)
a_delete buf;
return res;
}
-
OpenPOWER on IntegriCloud