From d5d5ea4d068d9272c665358ed84a6297d5dec226 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Mon, 15 Dec 2003 07:35:06 +0000 Subject: [PATCH] Patched bug(s) in postscipt driver --- src/groff-font.c | 25 +++++++++++++------------ src/postscript.c | 7 +++++-- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/groff-font.c b/src/groff-font.c index 835869af..d645b278 100644 --- a/src/groff-font.c +++ b/src/groff-font.c @@ -600,19 +600,20 @@ add_kern (struct font_desc *font, int ch1, int ch2, int adjust) for (i = 0; i < font->kern_size; i++) font->kern[i].ch1 = -1; - for (i = 0; i < old_kern_size; i++) - { - if (old_kern[i].ch1 == -1) - continue; - - j = hash_kern (old_kern[i].ch1, old_kern[i].ch2) % font->kern_size; - while (font->kern[j].ch1 != -1) - if (0 == j--) - j = font->kern_size - 1; - font->kern[j] = old_kern[i]; - } - if (old_kern) + if (old_kern) { + for (i = 0; i < old_kern_size; i++) + { + if (old_kern[i].ch1 == -1) + continue; + + j = hash_kern (old_kern[i].ch1, old_kern[i].ch2) % font->kern_size; + while (font->kern[j].ch1 != -1) + if (0 == j--) + j = font->kern_size - 1; + font->kern[j] = old_kern[i]; + } pool_free (font->owner, old_kern); + } } for (i = hash_kern (ch1, ch2) % font->kern_size; font->kern[i].ch1 != -1;) diff --git a/src/postscript.c b/src/postscript.c index 16d02094..dd1905d7 100644 --- a/src/postscript.c +++ b/src/postscript.c @@ -955,8 +955,11 @@ output_encodings (struct outp_driver *this) while (ds_get_config_line (f, &buf, &where)) { - char *sp; - + char *sp; + + if (buf.length == 0 ) + continue; + pschar = strtok_r (ds_value (&buf), " \t\r\n", &sp); code = strtok_r (NULL, " \t\r\n", &sp); if (*pschar == 0 || *code == 0) -- 2.30.2