From 4ececa2728f2aab7e29577f504fd93917d02b055 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Fri, 8 Jun 2012 20:34:20 -0700 Subject: [PATCH] Don't truncate xclass() on at first punctuation character! Replace punctuation with underscores instead. --- src/Fl_x.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 6307918..07326c1 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -1817,8 +1817,9 @@ void Fl_X::make_xid(Fl_Window* win, XVisualInfo *visual, Colormap colormap) if (win->xclass()) { char buffer[1024]; char *p; const char *q; - // truncate on any punctuation, because they break XResource lookup: - for (p = buffer, q = win->xclass(); isalnum(*q)||(*q&128);) *p++ = *q++; + // replace punctuation with underscores, because it breaks XResource lookup + for (p = buffer, q = win->xclass(); *q || (*q&128); q++) + *p++ = isalnum(*q) ? *q : '_'; *p++ = 0; // create the capitalized version: q = buffer; -- 2.11.4.GIT