Mercurial > hg > xemacs-beta
changeset 5335:c9d31263ab7d
Replace POSIX index(3) with C89 strchr(3), lwlib-fonts.c
2011-01-11 Aidan Kehoe <kehoea@parhasard.net>
* lwlib-fonts.c (xft_open_font_by_name):
Replace the POSIX index(3), not universally available even today,
with the C89 strchr(3), hopefully fixing a few of the buildbots'
problems.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Tue, 11 Jan 2011 13:39:35 +0000 |
parents | b249c479f9e1 |
children | 287499ff4c5f 7ebbe334061e |
files | lwlib/ChangeLog lwlib/lwlib-fonts.c |
diffstat | 2 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/lwlib/ChangeLog Mon Jan 10 20:00:57 2011 +0000 +++ b/lwlib/ChangeLog Tue Jan 11 13:39:35 2011 +0000 @@ -1,3 +1,10 @@ +2011-01-11 Aidan Kehoe <kehoea@parhasard.net> + + * lwlib-fonts.c (xft_open_font_by_name): + Replace the POSIX index(3), not universally available even today, + with the C89 strchr(3), hopefully fixing a few of the buildbots' + problems. + 2010-06-13 Stephen J. Turnbull <stephen@xemacs.org> * lwlib-internal.h: Correct FSF address in permission notice.
--- a/lwlib/lwlib-fonts.c Mon Jan 10 20:00:57 2011 +0000 +++ b/lwlib/lwlib-fonts.c Tue Jan 11 13:39:35 2011 +0000 @@ -76,7 +76,7 @@ int count = 0; char *pos = name; /* extra parens shut up gcc */ - while ((pos = index (pos, '-'))) + while ((pos = strchr (pos, '-'))) { count++; pos++; @@ -86,7 +86,7 @@ if (count == 14 /* fully-qualified XLFD */ || (count < 14 /* heuristic for wildcarded XLFD */ && count >= 5 - && index (name, '*'))) + && strchr (name, '*'))) res = XftFontOpenXlfd (dpy, DefaultScreen (dpy), name); else res = XftFontOpenName (dpy, DefaultScreen (dpy), name);