[MPlayer-cvslog] r38265 - trunk/gui/dialog/skinbrowser.c
ib
subversion at mplayerhq.hu
Fri Feb 26 16:07:07 EET 2021
Author: ib
Date: Fri Feb 26 16:07:07 2021
New Revision: 38265
Log:
Do not unconditionally add a "default" entry to the list of skins.
A skin directory or skin link "default" may not exist. So add
the entry only if there is a directory or link with this name.
Modified:
trunk/gui/dialog/skinbrowser.c
Modified: trunk/gui/dialog/skinbrowser.c
==============================================================================
--- trunk/gui/dialog/skinbrowser.c Fri Feb 26 16:02:20 2021 (r38264)
+++ trunk/gui/dialog/skinbrowser.c Fri Feb 26 16:07:07 2021 (r38265)
@@ -178,20 +178,22 @@ int FillSkinList( gchar * mdir )
str[0]="default";
str[1]="";
- if ( gtkFindInCList( SkinList,str[0] ) == -1 ) gtk_clist_append( GTK_CLIST( SkinList ),str );
glob( mdir,GLOB_NOSORT,NULL,&gg );
for( i=0;i<gg.gl_pathc;i++ )
{
if ( !strcmp( gg.gl_pathv[i],"." ) || !strcmp( gg.gl_pathv[i],".." ) ) continue;
- if ( ( stat( gg.gl_pathv[i],&fs ) == 0 ) && S_ISDIR( fs.st_mode ) )
+ if ( ( lstat( gg.gl_pathv[i],&fs ) == 0 ) )
{
tmp=strrchr( gg.gl_pathv[i],'/' );
if (tmp) tmp++;
else tmp = gg.gl_pathv[i];
- if ( !strcmp( tmp,"default" ) ) continue;
+ // only directories or a link named "default"
+ if ( S_ISDIR( fs.st_mode ) || ( ( fs.st_mode & S_IFMT ) == S_IFLNK && strcmp( tmp,"default" ) == 0 ) )
+ {
str[0]=tmp;
if ( gtkFindInCList( SkinList,str[0] ) == -1 ) gtk_clist_append( GTK_CLIST( SkinList ),str );
+ }
}
}
globfree( &gg );
More information about the MPlayer-cvslog
mailing list