[MPlayer-cvslog] CVS: main/Gui/skin skin.c,1.27,1.28

Reimar Döffinger CVS syncmail at mplayerhq.hu
Sat May 28 23:12:14 CEST 2005


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main/Gui/skin
In directory mail:/var2/tmp/cvs-serv368

Modified Files:
	skin.c 
Log Message:
last patch broke skin reading completely, becasue last line of skin
file is empty. Fix and simplify, since fgets can do feof's job, too...


Index: skin.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/skin/skin.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- skin.c	23 May 2005 20:12:47 -0000	1.27
+++ skin.c	28 May 2005 21:12:11 -0000	1.28
@@ -686,12 +686,8 @@
  appInitStruct( skinAppMPlayer );
 
  linenumber=0;
- while ( !feof( skinFile ) )
+ while (fgets(tmp, 255, skinFile))
   {
-   if (!fgets( tmp,255,skinFile )) {
-     mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_SKIN_SkinFileNotReadable, fn);
-     return -1;
-   }
    linenumber++;
 
    c=tmp[ strlen( tmp ) - 1 ]; if ( c == '\n' || c == '\r' ) tmp[ strlen( tmp ) - 1 ]=0;
@@ -714,5 +710,9 @@
     if ( !strcmp( command,skinItem[i].name ) )
      if ( skinItem[i].func( param ) ) return -2;
   }
+ if (linenumber == 0) {
+   mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_SKIN_SkinFileNotReadable, fn);
+   return -1;
+ }
  return 0;
 }




More information about the MPlayer-cvslog mailing list