summaryrefslogtreecommitdiff
path: root/zwgc/xshow.c
diff options
context:
space:
mode:
authorGravatar John Kohl <jtkohl@mit.edu>1989-12-07 04:28:26 +0000
committerGravatar John Kohl <jtkohl@mit.edu>1989-12-07 04:28:26 +0000
commit9053425e8604102a2c6dc6877605d42ff0753348 (patch)
tree25a4e2c5f59f0b7295f217ef41c45b5a93a08680 /zwgc/xshow.c
parent15d473b53564b4d540293d9e42ce4d8bae735732 (diff)
Changes from <marc>: do the proper mutation for @font(), @color()
Diffstat (limited to 'zwgc/xshow.c')
-rw-r--r--zwgc/xshow.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/zwgc/xshow.c b/zwgc/xshow.c
index e91e2a4..8969941 100644
--- a/zwgc/xshow.c
+++ b/zwgc/xshow.c
@@ -457,6 +457,14 @@ void xshow(dpy, desc, numstr, numnl)
(desc->next->next) &&
(desc->next->code == DT_STR) &&
(desc->next->next->code==DT_END)) {
+
+ /* Since @font mutates the current environment, we have
+ to pop the environment that this case usually pushes */
+ free(curmode.substyle);
+ curmode = xmode_stack_top(modes);
+ xmode_stack_pop(modes);
+
+ /* mutating... */
curmode.size=SPECIAL_SIZE; /* This is an @font() */
curmode.font=string_CreateFromData(desc->next->str,
desc->next->len);
@@ -473,6 +481,13 @@ void xshow(dpy, desc, numstr, numnl)
(desc->next->next->code==DT_END)) {
char *colorname;
+ /* Since @font mutates the current environment, we have
+ to pop the environment that this case usually pushes */
+ free(curmode.substyle);
+ curmode = xmode_stack_top(modes);
+ xmode_stack_pop(modes);
+
+ /* mutating... */
colorname=string_CreateFromData(desc->next->str,
desc->next->len);
curmode.color = x_string_to_color(colorname,default_fgcolor);