# HG changeset patch # User ib # Date 1298121611 0 # Node ID 084b39f800c753e034e4a11470303eaed572b4d3 # Parent fe8f9b5d3ba2c124bd0a83cde68733dfd8ce7e70 Simplify input preparation (analogously to font.c). diff -r fe8f9b5d3ba2 -r 084b39f800c7 gui/skin/skin.c --- 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