mirror of git://git.suckless.org/dmenu
drw.c: use the same pattern as ellipsis_width to check for infinite recursion
This commit is contained in:
parent
59936c7d97
commit
475d8093cb
4
drw.c
4
drw.c
|
@ -258,10 +258,8 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
|
||||||
usedfont = drw->fonts;
|
usedfont = drw->fonts;
|
||||||
if (!ellipsis_width && render)
|
if (!ellipsis_width && render)
|
||||||
ellipsis_width = drw_fontset_getwidth(drw, "...");
|
ellipsis_width = drw_fontset_getwidth(drw, "...");
|
||||||
if (!invalid_width) {
|
if (!invalid_width && render)
|
||||||
invalid_width = -1; /* stop infinite recursion */
|
|
||||||
invalid_width = drw_fontset_getwidth(drw, invalid);
|
invalid_width = drw_fontset_getwidth(drw, invalid);
|
||||||
}
|
|
||||||
while (1) {
|
while (1) {
|
||||||
ew = ellipsis_len = utf8err = utf8charlen = utf8strlen = 0;
|
ew = ellipsis_len = utf8err = utf8charlen = utf8strlen = 0;
|
||||||
utf8str = text;
|
utf8str = text;
|
||||||
|
|
Loading…
Reference in New Issue