tMake the plumber configurable in config.h. - sacc - sacc(omys), simple console gopher client (mirror) (HTM) git clone https://git.parazyd.org/sacc (DIR) Log (DIR) Files (DIR) Refs (DIR) LICENSE --- (DIR) commit d03c161c2aa47bf254336a7098caf428a4d58134 (DIR) parent 67cc5414425ecccc9f75a12f7ba4cc40b3f97fa7 (HTM) Author: Christoph Lohmann <20h@r-36.net> Date: Tue, 25 Jul 2017 18:55:34 +0200 Make the plumber configurable in config.h. Diffstat: M Makefile | 5 ++++- A config.def.h | 4 ++++ M sacc.c | 4 +++- 3 files changed, 11 insertions(+), 2 deletions(-) --- (DIR) diff --git a/Makefile b/Makefile t@@ -9,7 +9,10 @@ OBJ = $(BIN:=.o) ui_$(UI).o all: $(BIN) -$(BIN): config.mk common.h $(OBJ) +config.h: + cp config.def.h config.h + +$(BIN): config.h config.mk common.h $(OBJ) $(CC) $(OBJ) $(SACCLDFLAGS) -o $@ clean: (DIR) diff --git a/config.def.h b/config.def.h t@@ -0,0 +1,4 @@ +/* See LICENSE file for copyright and license details. */ + +static char *plumber = "xdg-open"; + (DIR) diff --git a/sacc.c b/sacc.c t@@ -20,6 +20,8 @@ #include "common.h" +#include "config.h" + static char *mainurl; static Item *mainentry; static int parent = 1; t@@ -471,7 +473,7 @@ plumb(char *url) return; case 0: parent = 0; - if (execlp("xdg-open", "xdg-open", url, NULL) < 0) + if (execlp(plumber, plumber, url, NULL) < 0) die("execlp: %s", strerror(errno)); } }