From cbd4d50912798981349c01705968f55b118dc6df Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Tue, 30 Apr 2002 01:29:14 +0000 Subject: [PATCH] xlib complains a lot about fonts with '*' in the XLFD string. Bug 136743, patch by Roland.Mainz@informatik.med.uni-giessen.de (Roland Mainz), r=bstell, sr=attinasi git-svn-id: svn://10.0.0.236/trunk@120271 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/gfx/src/gtk/nsFontMetricsGTK.cpp | 6 +++++- mozilla/gfx/src/xlib/nsFontMetricsXlib.cpp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mozilla/gfx/src/gtk/nsFontMetricsGTK.cpp b/mozilla/gfx/src/gtk/nsFontMetricsGTK.cpp index 79b856e0a4e..2775e26cea8 100644 --- a/mozilla/gfx/src/gtk/nsFontMetricsGTK.cpp +++ b/mozilla/gfx/src/gtk/nsFontMetricsGTK.cpp @@ -3744,7 +3744,11 @@ GetFontNames(const char* aPattern, PRBool aAnyFoundry, nsFontNodeArray* aNodes) char name[256]; /* X11 font names are never larger than 255 chars */ strcpy(name, list[i]); - if ((!name) || (name[0] != '-')) { + /* Check if we can handle the font name ('*' and '?' are only valid in + * input patterns passed as argument to |XListFont()|&co. but _not_ in + * font names returned by these functions (see bug 136743 ("xlib complains + * a lot about fonts with '*' in the XLFD string"))) */ + if ((!name) || (name[0] != '-') || (PL_strpbrk(name, "*?") != nsnull)) { continue; } diff --git a/mozilla/gfx/src/xlib/nsFontMetricsXlib.cpp b/mozilla/gfx/src/xlib/nsFontMetricsXlib.cpp index 688fb85df5a..d2eef692003 100644 --- a/mozilla/gfx/src/xlib/nsFontMetricsXlib.cpp +++ b/mozilla/gfx/src/xlib/nsFontMetricsXlib.cpp @@ -4045,7 +4045,11 @@ GetFontNames(const char* aPattern, PRBool aAnyFoundry, nsFontNodeArrayXlib* aNod for (int i = 0; i < count; i++) { char name[256]; /* X11 font names are never larger than 255 chars */ - if ((!list[i]) || (list[i][0] != '-')) { + /* Check if we can handle the font name ('*' and '?' are only valid in + * input patterns passed as argument to |XListFont()|&co. but _not_ in + * font names returned by these functions (see bug 136743 ("xlib complains + * a lot about fonts with '*' in the XLFD string"))) */ + if ((!list[i]) || (list[i][0] != '-') || (PL_strpbrk(list[i], "*?") != nsnull)) { continue; }