diff options
author | C. McEnroe | 2020-10-09 18:45:52 -0400 |
---|---|---|
committer | C. McEnroe | 2020-10-09 18:45:52 -0400 |
commit | c48672313b910cade2ec5050ded95713a3a2b5b9 (patch) | |
tree | 430aa29c55dd301db40e65dad32766a685073a74 /ui.c | |
parent | f7f5acbbe2a848d2c827aed0fe8410e48300c1e9 (diff) |
Factor out styleStrip
Diffstat (limited to 'ui.c')
-rw-r--r-- | ui.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/ui.c b/ui.c index 22ec02e..e2b832e 100644 --- a/ui.c +++ b/ui.c @@ -534,16 +534,11 @@ struct Util uiNotifyUtil; static void notify(uint id, const char *str) { if (!uiNotifyUtil.argc) return; + char buf[1024] = ""; + styleStrip(&(struct Cat) { buf, sizeof(buf), 0 }, str); + struct Util util = uiNotifyUtil; utilPush(&util, idNames[id]); - char buf[1024] = ""; - struct Cat cat = { buf, sizeof(buf), 0 }; - while (*str) { - struct Style style = StyleDefault; - size_t len = styleParse(&style, &str); - catf(&cat, "%.*s", (int)len, str); - str += len; - } utilPush(&util, buf); pid_t pid = fork(); |