changeset 32843:084b39f800c7

Simplify input preparation (analogously to font.c).
author ib
date Sat, 19 Feb 2011 13:20:11 +0000
parents fe8f9b5d3ba2
children 002a3bf7ce85
files gui/skin/skin.c
diffstat 1 files changed, 7 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/gui/skin/skin.c	Sat Feb 19 12:50:54 2011 +0000
+++ b/gui/skin/skin.c	Sat Feb 19 13:20:11 2011 +0000
@@ -685,7 +685,7 @@
  unsigned char * ptmp;
  unsigned char   command[32];
  unsigned char   param[256];
- int             c,i;
+ int             i;
 
  setname( skinDirInHome,dname );
  if ( ( skinFile = fopen( fn,"rt" ) ) == NULL )
@@ -718,19 +718,12 @@
 
    // remove any kind of newline, if any
    tmp[strcspn(tmp, "\n\r")] = 0;
-   for ( c=0;c<(int)strlen( tmp );c++ )
-    if ( tmp[c] == ';' )
-     {
-      tmp[c]=0;
-      break;
-     }
-   if ( strlen( tmp ) == 0 ) continue;
-   ptmp=trimleft( tmp );
-   if ( strlen( ptmp ) == 0 ) continue;
-   ptmp=strswap( ptmp,'\t',' ' );
-   ptmp=trim( ptmp );
-
-   cutItem( ptmp,command,'=',0 ); cutItem( ptmp,param,'=',1 );
+   strswap( tmp,'\t',' ' );
+   trim( tmp );
+   ptmp = strchr(tmp, ';');
+   if (ptmp) *ptmp = 0;
+   if (!*tmp) continue;
+   cutItem( tmp,command,'=',0 ); cutItem( tmp,param,'=',1 );
    strlower( command );
    for( i=0;i<ITEMS;i++ )
     if ( !strcmp( command,skinItem[i].name ) )