Return a valid X error when stuck in font alias loop

Part of fix for Sun bug 4258475
<http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=4258475>
(cherry picked from commit 1a01e96c6d)
This commit is contained in:
Alan Coopersmith 2008-05-09 15:38:44 -07:00 committed by Jeremy Huddleston
parent 389e2656c0
commit 696d2d7109

View File

@ -301,8 +301,14 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
c->fontname = newname;
c->fnamelen = newlen;
c->current_fpe = 0;
if (--aliascount <= 0)
if (--aliascount <= 0) {
/* We've tried resolving this alias 20 times, we're
* probably stuck in an infinite loop of aliases pointing
* to each other - time to take emergency exit!
*/
err = BadImplementation;
break;
}
continue;
}
if (err == BadFontName) {