pinosaur
/
dwmblocks.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed issue with empty command delimiter
[dwmblocks.git]
/
dwmblocks.c
diff --git
a/dwmblocks.c
b/dwmblocks.c
index
e3e34a1
..
c66dbc7
100644
(file)
--- 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);
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;
if (delim[0] != '\0') {
//only chop off newline if one is present at the end
i = output[i-1] == '\n' ? i-1 : i;