wmtv: Start without user config file.
Patch by Nicolas Boullis <Boullis.Nicolas@libertysurf.fr>. From [1]: From: Nicolas Boullis <Boullis.Nicolas@libertysurf.fr> 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
This commit is contained in:
parent
f419f26a17
commit
bfc1c00d8e
1 changed files with 8 additions and 6 deletions
|
@ -1130,19 +1130,21 @@ InitConfig(void)
|
||||||
int i;
|
int i;
|
||||||
char temp[128];
|
char temp[128];
|
||||||
|
|
||||||
strcpy(temp, "/etc/wmtvrc");
|
|
||||||
ParseRCFile(temp, wmtv_keys);
|
|
||||||
ParseRCFile2(temp);
|
|
||||||
|
|
||||||
strncpy(temp, (char *)getenv("HOME"), (sizeof(char)*128));
|
strncpy(temp, (char *)getenv("HOME"), (sizeof(char)*128));
|
||||||
strcat(temp, "/.wmtvrc");
|
strcat(temp, "/.wmtvrc");
|
||||||
ParseRCFile(temp, wmtv_keys);
|
ParseRCFile(temp, wmtv_keys);
|
||||||
ParseRCFile2(temp);
|
ParseRCFile2(temp);
|
||||||
|
|
||||||
|
if (norcfile) {
|
||||||
|
strcpy(temp, "/etc/wmtvrc");
|
||||||
|
ParseRCFile(temp, wmtv_keys);
|
||||||
|
ParseRCFile2(temp);
|
||||||
|
|
||||||
if (norcfile) {
|
if (norcfile) {
|
||||||
fprintf(stderr, "wmtv: error - config file not found\n");
|
fprintf(stderr, "wmtv: error - config file not found\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (maxpreset != NULL)
|
if (maxpreset != NULL)
|
||||||
maxpst = atoi(maxpreset) - 1;
|
maxpst = atoi(maxpreset) - 1;
|
||||||
|
|
Loading…
Reference in a new issue