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

ib subversion at mplayerhq.hu
Thu Feb 9 16:12:58 CET 2012


Author: ib
Date: Thu Feb  9 16:12:58 2012
New Revision: 34676

Log:
Prevent reading empty lines.

Modified:
   trunk/gui/cfg.c

Modified: trunk/gui/cfg.c
==============================================================================
--- trunk/gui/cfg.c	Thu Feb  9 16:02:16 2012	(r34675)
+++ trunk/gui/cfg.c	Thu Feb  9 16:12:58 2012	(r34676)
@@ -277,6 +277,9 @@ void cfg_read(void)
         while (fgetstr(line, sizeof(line), file)) {
             plItem *item;
 
+            if (!*line)
+                continue;
+
             item = calloc(1, sizeof(plItem));
 
             if (!item) {
@@ -286,7 +289,7 @@ void cfg_read(void)
 
             item->path = strdup(line);
 
-            if (fgetstr(line, sizeof(line), file)) {
+            if (fgetstr(line, sizeof(line), file) && *line) {
                 item->name = strdup(line);
                 listSet(gtkAddPlItem, item);
             } else {
@@ -309,6 +312,9 @@ void cfg_read(void)
         while (fgetstr(line, sizeof(line), file)) {
             urlItem *item;
 
+            if (!*line)
+                continue;
+
             item = calloc(1, sizeof(urlItem));
 
             if (!item) {
@@ -334,7 +340,7 @@ void cfg_read(void)
         unsigned int i = 0;
 
         while (fgetstr(line, sizeof(line), file))
-            if (i < FF_ARRAY_ELEMS(fsHistory))
+            if (*line && (i < FF_ARRAY_ELEMS(fsHistory)))
                 fsHistory[i++] = gstrdup(line);
 
         fclose(file);


More information about the MPlayer-cvslog mailing list