summaryrefslogtreecommitdiff
path: root/fofi/FoFiType1.cc
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2005-09-14 21:20:36 +0000
committerAlbert Astals Cid <aacid@kde.org>2005-09-14 21:20:36 +0000
commit4b4fc5c017bf147c9069bbce32fc14467bd2a81a (patch)
treecc6889d533182bf89b10b435a46c18c670431dcc /fofi/FoFiType1.cc
parenta68e8e6330418b1f623867973b9c128a9a139c0c (diff)
Merge all the fofi/ changes from xpdf 3.01, there is only one api change that affects PSOutputDev (also has been updated the part that uses this api not the whole file). All our fixes in that dir are included in the upgrade.
Diffstat (limited to 'fofi/FoFiType1.cc')
-rw-r--r--fofi/FoFiType1.cc25
1 files changed, 12 insertions, 13 deletions
diff --git a/fofi/FoFiType1.cc b/fofi/FoFiType1.cc
index ef27a3c6..19753dc4 100644
--- a/fofi/FoFiType1.cc
+++ b/fofi/FoFiType1.cc
@@ -108,6 +108,9 @@ void FoFiType1::writeEncoded(char **newEncoding,
for (line = getNextLine(line);
line && strncmp(line, "readonly def", 12);
line = getNextLine(line)) ;
+ if (line) {
+ line = getNextLine(line);
+ }
}
if (line) {
(*outputFunc)(outputStream, line, ((char *)file + len) - line);
@@ -160,9 +163,9 @@ void FoFiType1::parse() {
for (j = 0; j < 256; ++j) {
encoding[j] = NULL;
}
- line = getNextLine(line);
- for (j = 0; j < 300 && line; ++j) {
- line1 = getNextLine(line);
+ for (j = 0, line = getNextLine(line);
+ j < 300 && line && (line1 = getNextLine(line));
+ ++j, line = line1) {
if ((n = line1 - line) > 255) {
n = 255;
}
@@ -186,22 +189,18 @@ void FoFiType1::parse() {
}
}
}
- }
-
- // Any line that begins with "def" or contains " def"
- // terminates the encoding array.
- if (!strcmp (p, "def") || strstr (buf, " def"))
- break;
-
- line = line1;
+ } else {
+ if (strtok(buf, " \t") &&
+ (p = strtok(NULL, " \t\n\r")) && !strcmp(p, "def")) {
+ break;
+ }
+ }
}
//~ check for getinterval/putinterval junk
} else {
line = getNextLine(line);
}
-
- ++i;
}
parsed = gTrue;