From bfc1c00d8ea37d91536f924de75b81006d906377 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Mon, 1 Feb 2016 00:45:12 -0500 Subject: [PATCH] wmtv: Start without user config file. Patch by Nicolas Boullis . From [1]: From: Nicolas Boullis Subject: wmtv: does not start without user's ~/.wmtvrc Date: Sun, 18 Nov 2001 00:17:26 +0100 Hi ! The current version of wmtv does not start if the user does not have a ~/.wmtvrc configuration file, while one could expect it to work with the system wide configuration file /etc/wmtvrc. This patch allows wmtv to start with the system wide configuration file alone. [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=120024 --- wmtv/src/wmtv.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/wmtv/src/wmtv.c b/wmtv/src/wmtv.c index 7e2d663..bc160d5 100644 --- a/wmtv/src/wmtv.c +++ b/wmtv/src/wmtv.c @@ -1130,18 +1130,20 @@ InitConfig(void) int i; char temp[128]; - strcpy(temp, "/etc/wmtvrc"); - ParseRCFile(temp, wmtv_keys); - ParseRCFile2(temp); - strncpy(temp, (char *)getenv("HOME"), (sizeof(char)*128)); strcat(temp, "/.wmtvrc"); ParseRCFile(temp, wmtv_keys); ParseRCFile2(temp); if (norcfile) { - fprintf(stderr, "wmtv: error - config file not found\n"); - exit(1); + strcpy(temp, "/etc/wmtvrc"); + ParseRCFile(temp, wmtv_keys); + ParseRCFile2(temp); + + if (norcfile) { + fprintf(stderr, "wmtv: error - config file not found\n"); + exit(1); + } } if (maxpreset != NULL)