wmtv: Do not shorten user config file.

Patch by Nicolas Boullis <Boullis.Nicolas@libertysurf.fr>.  From [1]:

   From: Nicolas Boullis <Boullis.Nicolas@libertysurf.fr>
   Subject: wmtv: shortens user's configuration file
   Date: Sun, 18 Nov 2001 02:38:00 +0100

   Hello !

   When wmtv writes it configuration back to the user's configuration file
   (after the user tried to fine-tune the channels) it forgets the last
   channel. And then... one can't start it any more without correcting the
   configuration file first.

   The patch included makes wmtv write all the channels back.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=120035
This commit is contained in:
Doug Torrance 2016-02-01 00:45:13 -05:00 committed by Carlos R. Mafra
parent bfc1c00d8e
commit 2090a44629

View file

@ -1070,7 +1070,7 @@ WriteRCFile(const char *filename)
while (fgets(temp, 128, fp)) { while (fgets(temp, 128, fp)) {
if (*temp != '\n' && strchr(temp, '[')) { if (*temp != '\n' && strchr(temp, '[')) {
fseek(fp, 0L, SEEK_CUR); /* required between read and write */ fseek(fp, 0L, SEEK_CUR); /* required between read and write */
for (i = 0; i < maxpst; i++) for (i = 0; i <= maxpst; i++)
fprintf(fp, "%s (%ld)\t%s", cname[i], ftune[i], comment[i]); fprintf(fp, "%s (%ld)\t%s", cname[i], ftune[i], comment[i]);
break; break;
} }