aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraidan <aidan@Edward.localdomain>2020-08-29 11:58:28 -0600
committeraidan <aidan@Edward.localdomain>2020-08-29 11:58:28 -0600
commit13c7700f34b74c4cf91dfb261c61ca1ca1eac6c3 (patch)
tree98f3893fa8d8ac8169831f8551b251af639c4b13
parent3d308cafb0f3a56e9247e6a9aaf9da6e279a5bc6 (diff)
Fixed issue with empty command delimiter
This meant that the delimiters were added when when both the icon and output where empty.
-rw-r--r--dwmblocks.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/dwmblocks.c b/dwmblocks.c
index e3e34a1..c66dbc7 100644
--- a/dwmblocks.c
+++ b/dwmblocks.c
@@ -56,6 +56,8 @@ void getcmd(const Block *block, char *output)
int i = strlen(block->icon);
fgets(output+i, CMDLENGTH-i-delimLen, cmdf);
i = strlen(output);
+ if (i == 0)//return if block and command output are both empty
+ return;
if (delim[0] != '\0') {
//only chop off newline if one is present at the end
i = output[i-1] == '\n' ? i-1 : i;