Updated the patch in README.md for commit
b6b0be4
PREFIX ?= /usr/local
CC ?= cc
+LDFLAGS = -lX11
output: dwmblocks.c blocks.def.h blocks.h
- ${CC} `pkg-config --cflags x11 --libs x11` dwmblocks.c -o dwmblocks
+ ${CC} dwmblocks.c $(LDFLAGS) -o dwmblocks
blocks.h:
cp blocks.def.h $@
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
+ if (i == 0) {
+ //return if block and command output are both empty
+ pclose(cmdf);
return;
+ }
if (delim[0] != '\0') {
//only chop off newline if one is present at the end
i = output[i-1] == '\n' ? i-1 : i;