From: Chris Hanson Date: Sat, 29 Nov 1997 04:37:25 +0000 (+0000) Subject: Change font-name parsing code so that it will properly parse fonts X-Git-Tag: 20090517-FFI~4924 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=58d13296f05d03c4c02b042b641fb7a9a20b14f5;p=mit-scheme.git Change font-name parsing code so that it will properly parse fonts whose names begin with a digit. --- diff --git a/v7/src/microcode/ntscreen.c b/v7/src/microcode/ntscreen.c index 0dc8bc89b..0a60c54ac 100644 --- a/v7/src/microcode/ntscreen.c +++ b/v7/src/microcode/ntscreen.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: ntscreen.c,v 1.30 1997/06/19 05:14:14 cph Exp $ +$Id: ntscreen.c,v 1.31 1997/11/29 04:37:25 cph Exp $ Copyright (c) 1993-97 Massachusetts Institute of Technology @@ -3465,9 +3465,11 @@ parse_logfont (char * name, LOGFONT * lf) { int i = 0; int name_ended = 0; + int number_p; int len; char * start = name; char * end = name; + char * scan; while (1) { @@ -3476,11 +3478,27 @@ parse_logfont (char * name, LOGFONT * lf) if ((*start) == '\0') return (TRUE); end = start; - while (((*end) != ' ') && ((*end) != 0)) + while (((*end) != ' ') && ((*end) != '\0')) end += 1; len = (end - start); - - if ((((*start) >= '0') && ((*start) <= '9')) || ((*start) == '-')) + scan = start; + number_p = 0; + if (scan < end) + while (1) + { + if (scan == end) + { + number_p = 1; + break; + } + if (! (((*scan) >= '0') && ((*scan) <= '9'))) + { + number_p = 0; + break; + } + scan += 1; + } + if (number_p) { long points = (atol (start)); (lf -> lfHeight) = (- (points_to_logical_units (points)));