]> git.armaanb.net Git - dwmblocks.git/commitdiff
Merge pull request #40 from IGeraGera/IGeraGera-patch-1
authortorrinfail <torrinfail@gmail.com>
Sun, 27 Dec 2020 20:43:03 +0000 (13:43 -0700)
committerGitHub <noreply@github.com>
Sun, 27 Dec 2020 20:43:03 +0000 (13:43 -0700)
Updated the patch in README.md for commit b6b0be4

Makefile
dwmblocks.c

index 8b3a30e01f5da77d38bef24832d70e3cd7e591ea..ef43ef4f1f8bbb8fc84f6e0d6d1b558a59203711 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,9 @@
 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 $@
 
index 64ad7a33e2d6b6acf39f28b899e1a74a23be9cee..ded717c197508c0453a36a562e82574fccb8ef49 100644 (file)
@@ -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;