X-Git-Url: https://git.armaanb.net/?p=dwmblocks.git;a=blobdiff_plain;f=dwmblocks.c;fp=dwmblocks.c;h=ded717c197508c0453a36a562e82574fccb8ef49;hp=64ad7a33e2d6b6acf39f28b899e1a74a23be9cee;hb=0e22e81b1e952e13534d7e5068be57a4d8396d87;hpb=5b8eb5f7b146db4a2089fe1ca96b243a5c471e84 diff --git a/dwmblocks.c b/dwmblocks.c index 64ad7a3..ded717c 100644 --- a/dwmblocks.c +++ b/dwmblocks.c @@ -65,8 +65,11 @@ 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 + 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;