diff options
author | ru <ru@FreeBSD.org> | 2002-10-11 08:52:17 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2002-10-11 08:52:17 +0000 |
commit | 49694bd3ad767a896dc092289a2b59c780a3ba02 (patch) | |
tree | 3ab4ff2268c18cde66cbf296cc57caf69acdea70 /contrib/groff/src/preproc/grn/hdb.cc | |
parent | b6731a278e1260409b42bb486cc7592dd1a19203 (diff) | |
parent | 127e61728bacf1fb90edd8be1b0c406619e78bc8 (diff) | |
download | FreeBSD-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/preproc/grn/hdb.cc')
-rw-r--r-- | contrib/groff/src/preproc/grn/hdb.cc | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/contrib/groff/src/preproc/grn/hdb.cc b/contrib/groff/src/preproc/grn/hdb.cc index fd5bb48..648a535 100644 --- a/contrib/groff/src/preproc/grn/hdb.cc +++ b/contrib/groff/src/preproc/grn/hdb.cc @@ -15,6 +15,7 @@ #include "error.h" #define MAXSTRING 128 +#define MAXSTRING_S "127" /* imports from main.cc */ @@ -89,7 +90,7 @@ DBRead(register FILE *file) SUNFILE = FALSE; elist = DBInit(); - (void) fscanf(file, "%s\n", string); + (void) fscanf(file, "%" MAXSTRING_S "s%*[^\n]\n", string); if (strcmp(string, "gremlinfile")) { if (strcmp(string, "sungremlinfile")) { error("`%1' is not a gremlin file", gremlinfile); @@ -103,10 +104,10 @@ DBRead(register FILE *file) done = FALSE; while (!done) { - /* if (fscanf(file,"%s\n", string) == EOF) */ + /* if (fscanf(file,"%" MAXSTRING_S "s\n", string) == EOF) */ /* I changed the scanf format because the element */ /* can have two words (e.g. CURVE SPLINE) */ - if (fscanf(file, "\n%[^\n]\n", string) == EOF) { + if (fscanf(file, "\n%" MAXSTRING_S "[^\n]%*[^\n]\n", string) == EOF) { error("`%1', error in file format", gremlinfile); return (elist); } @@ -210,8 +211,20 @@ DBGetType(register char *s) case 'A': return (ARC); case 'C': - if (s[1] == 'U') - return (CURVE); + if (s[1] == 'U') { + if (s[5] == '\n') + return (CURVE); + switch (s[7]) { + case 'S': + return(BSPLINE); + case 'E': + fprintf(stderr, + "Warning: Bezier Curves will be printed as B-Splines\n"); + return(BSPLINE); + default: + return(CURVE); + } + } switch (s[4]) { case 'L': return (CENTLEFT); |