aboutsummaryrefslogtreecommitdiff
path: root/swaybar
diff options
context:
space:
mode:
authorMikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-01-03 17:48:47 +0100
committerMikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-01-03 17:48:47 +0100
commitc2f3530fab9c96318e0a1e4b21e02e54792d5900 (patch)
tree3b6f8612a441e4db3db0c4f12726854d63000a6b /swaybar
parentccdcdc339679284887778ec1eff548afdc4c5511 (diff)
Only strip when starting with a num
This makes sure the `:` isn't striped if you have a workspace named: `:something`.
Diffstat (limited to 'swaybar')
-rw-r--r--swaybar/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/swaybar/main.c b/swaybar/main.c
index 34c54287..3ac337d1 100644
--- a/swaybar/main.c
+++ b/swaybar/main.c
@@ -580,7 +580,7 @@ char *handle_workspace_number(bool strip_num, const char *ws_name) {
int len = strlen(ws_name);
for (i = 0; i < len; ++i) {
if (!('0' <= ws_name[i] && ws_name[i] <= '9')) {
- if (':' == ws_name[i] && i < len-1) {
+ if (':' == ws_name[i] && i < len-1 && i > 0) {
strip = true;
++i;
}