From 832d1ee52474bf61b7bb1f3d308b9ff2b871b23b Mon Sep 17 00:00:00 2001 From: Marc Horowitz Date: Thu, 30 Nov 1989 16:32:35 +0000 Subject: fixed problem with default value of $style variable --- zwgc/xshow.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'zwgc/xshow.c') 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) { -- cgit v1.2.3