Skip to content

Commit

Permalink
Fixed issue with empty command delimiter
Browse files Browse the repository at this point in the history
This meant that the delimiters were added when when both the icon and
output where empty.
  • Loading branch information
aidan authored and aidan committed Aug 29, 2020
1 parent 3d308ca commit 13c7700
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dwmblocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 13c7700

Please sign in to comment.