diff options
author | Timo Sirainen <cras@irssi.org> | 2001-10-21 17:56:42 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-10-21 17:56:42 +0000 |
commit | bc8ee2d26c95bd2ce5ae9c5dee9b057fec6367df (patch) | |
tree | 2ce95f3133b7eb5161a9f63fde703d165f5492e5 /src/fe-common/core | |
parent | 6f8a3bd08d3167658b62c78b3252cd4c28a780ac (diff) | |
download | irssi-bc8ee2d26c95bd2ce5ae9c5dee9b057fec6367df.zip |
Don't expand %{ and %} in themes to { and } - they could be treated as
abstracts again. Printing %{ and %} now prints just { and }. This fixes
printing {stuff} in statusbar (eg. {nick}).
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1885 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/core')
-rw-r--r-- | src/fe-common/core/formats.c | 9 | ||||
-rw-r--r-- | src/fe-common/core/themes.c | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/fe-common/core/formats.c b/src/fe-common/core/formats.c index ef1b79d7..515a48a3 100644 --- a/src/fe-common/core/formats.c +++ b/src/fe-common/core/formats.c @@ -105,6 +105,12 @@ int format_expand_styles(GString *out, const char **format, int *flags) fmt = **format; switch (fmt) { + case '{': + case '}': + case '%': + /* escaped char */ + g_string_append_c(out, fmt); + break; case 'U': /* Underline on/off */ g_string_append_c(out, 4); @@ -121,9 +127,6 @@ int format_expand_styles(GString *out, const char **format, int *flags) g_string_append_c(out, 4); g_string_append_c(out, FORMAT_STYLE_REVERSE); break; - case '%': - g_string_append_c(out, '%'); - break; case ':': /* Newline */ g_string_append_c(out, '\n'); diff --git a/src/fe-common/core/themes.c b/src/fe-common/core/themes.c index a6881fa6..c7f8cf7b 100644 --- a/src/fe-common/core/themes.c +++ b/src/fe-common/core/themes.c @@ -212,7 +212,9 @@ static void theme_format_append_next(THEME_REC *theme, GString *str, return; } - /* %{ or %} gives us { or } char */ + /* %{ or %} gives us { or } char - keep the % char + though to make sure {} isn't treated as abstract */ + g_string_append_c(str, '%'); chr = **format; } |