[MPlayer-cvslog] r34682 - trunk/gui/cfg.c

ib subversion at mplayerhq.hu
Fri Feb 10 16:06:59 CET 2012


Author: ib
Date: Fri Feb 10 16:06:59 2012
New Revision: 34682

Log:
Don't destroy list pointers while saving list items.

Use temporary pointers instead.

Modified:
   trunk/gui/cfg.c

Modified: trunk/gui/cfg.c
==============================================================================
--- trunk/gui/cfg.c	Fri Feb 10 15:57:29 2012	(r34681)
+++ trunk/gui/cfg.c	Fri Feb 10 16:06:59 2012	(r34682)
@@ -391,15 +391,15 @@ void cfg_write(void)
     file  = fopen(fname, "wt+");
 
     if (file) {
-        plCurrent = plList;
+        plItem *item = plList;
 
-        while (plCurrent) {
-            if (plCurrent->path && plCurrent->name) {
-                fprintf(file, "%s\n", plCurrent->path);
-                fprintf(file, "%s\n", plCurrent->name);
+        while (item) {
+            if (item->path && item->name) {
+                fprintf(file, "%s\n", item->path);
+                fprintf(file, "%s\n", item->name);
             }
 
-            plCurrent = plCurrent->next;
+            item = item->next;
         }
 
         fclose(file);
@@ -413,11 +413,13 @@ void cfg_write(void)
     file  = fopen(fname, "wt+");
 
     if (file) {
-        while (urlList) {
-            if (urlList->url)
-                fprintf(file, "%s\n", urlList->url);
+        urlItem *item = urlList;
 
-            urlList = urlList->next;
+        while (item) {
+            if (item->url)
+                fprintf(file, "%s\n", item->url);
+
+            item = item->next;
         }
 
         fclose(file);


More information about the MPlayer-cvslog mailing list