X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fgroff-font.c;h=e5811ef40de411a824d048d2d77b6a030e969f66;hb=6ac27d1da3fdebee275343fcf7b6625fc1f1da79;hp=9427089d3009f330e1e5997a6c59aab56583862e;hpb=2990bac9e19a4a92606c830ab39ef3eb1e555481;p=pspp diff --git a/src/groff-font.c b/src/groff-font.c index 9427089d30..e5811ef40d 100644 --- a/src/groff-font.c +++ b/src/groff-font.c @@ -28,11 +28,15 @@ #include "alloc.h" #include "error.h" #include "filename.h" +#include "getline.h" #include "hash.h" #include "pool.h" #include "str.h" #include "version.h" +#include "gettext.h" +#define _(msgid) gettext (msgid) + int font_number_to_index (int); int space_index; @@ -388,10 +392,15 @@ lose: static int font_msg (int class, const char *format,...) { + struct error error; va_list args; + error.class = class; + err_location (&error.where); + error.title = _("installation error: Groff font error: "); + va_start (args, format); - tmsg (class, format, args, _("installation error: Groff font error: ")); + err_vmsg (&error, format, args); va_end (args); return 0; @@ -402,7 +411,7 @@ font_msg (int class, const char *format,...) static void scan_badchars (char *line, int len) { - unsigned char *cp = line; + char *cp = line; /* Same bad characters as Groff. */ static unsigned char badchars[32] = @@ -413,12 +422,15 @@ scan_badchars (char *line, int len) 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; - for (; len--; cp++) - if (badchars[*cp >> 3] & (1 << (*cp & 7))) - { - font_msg (SE, _("Bad character \\%3o."), *cp); - *cp = ' '; - } + for (; len--; cp++) + { + int c = (unsigned char) *cp; + if (badchars[c >> 3] & (1 << (c & 7))) + { + font_msg (SE, _("Bad character \\%3o."), *cp); + *cp = ' '; + } + } } /* Character name hashing. */