summaryrefslogtreecommitdiff
path: root/zwgc/xshow.c
diff options
context:
space:
mode:
authorGravatar Marc Horowitz <marc@mit.edu>1989-11-30 16:32:35 +0000
committerGravatar Marc Horowitz <marc@mit.edu>1989-11-30 16:32:35 +0000
commit832d1ee52474bf61b7bb1f3d308b9ff2b871b23b (patch)
tree53b4d23c32cdd0abc8bc7b0ce7c201b40249ccc1 /zwgc/xshow.c
parent80bc70bb35155a72f110dd34d5cde5f0e491a8ac (diff)
fixed problem with default value of $style variable
Diffstat (limited to 'zwgc/xshow.c')
-rw-r--r--zwgc/xshow.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/zwgc/xshow.c b/zwgc/xshow.c
index 291c75f..de72be9 100644
--- a/zwgc/xshow.c
+++ b/zwgc/xshow.c
@@ -362,6 +362,19 @@ void fixup_and_draw(dpy, style, auxblocks, blocks, num, lines, numlines,
gram_ypos, gram_xsize, gram_ysize, beepcount);
}
+/* Silly almost-but-not-quite-useless helper function */
+char *no_dots_downcase_var(str)
+ char *str;
+{
+ char *var;
+
+ var = string_Downcase(var_get_variable(str));
+ while (*var++)
+ if (*var == '.')
+ *var = '_';
+ return(var);
+}
+
#define MODE_TO_FONT(dpy,style,mode) \
get_font((dpy),(style),(mode)->font?(mode)->font:(mode)->substyle, \
(mode)->size, (mode)->bold+(mode)->italic*2)
@@ -397,10 +410,11 @@ void xshow(dpy, desc, numstr, numnl)
style = var_get_variable("style");
if (style[0] == '\0') {
- style = string_Concat(var_get_variable("class"),".");
- style = string_Concat2(style,var_get_variable("instance"));
+ style = string_Concat(no_dots_downcase_var("class"),".");
+ style = string_Concat2(style,no_dots_downcase_var("instance"));
style = string_Concat2(style,".");
- style = string_Concat2(style,var_get_variable("sender"));
+ style = string_Concat2(style,no_dots_downcase_var("sender"));
+ string_Downcase(style);
}
for (; desc->code!=DT_EOF; desc=desc->next) {