[hackers] [dwm][PATCH] Do not call die() upon '-v' invocation

From: Klemens Nanni <kl3_AT_posteo.org>
Date: Fri, 28 Oct 2016 14:40:01 +0200

Returning -1 upon a valid invocation like 'dwm -v' is just wrong.
---
 dwm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dwm.c b/dwm.c
index 421bf27..35828b4 100644
--- a/dwm.c
+++ b/dwm.c
_AT_@ -2122,8 +2122,10 @@ zoom(const Arg *arg)
 int
 main(int argc, char *argv[])
 {
-	if (argc == 2 && !strcmp("-v", argv[1]))
-		die("dwm-"VERSION);
+	if (argc == 2 && !strcmp("-v", argv[1])) {
+		fputs("dwm-"VERSION, stderr);
+		return EXIT_SUCCESS;
+	}
 	else if (argc != 1)
 		die("usage: dwm [-v]");
 	if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())
-- 
2.8.3
Received on Fri Oct 28 2016 - 14:40:01 CEST

This archive was generated by hypermail 2.3.0 : Fri Oct 28 2016 - 14:48:16 CEST