diff options
author | pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-01-18 01:07:46 +0000 |
---|---|---|
committer | pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-01-18 01:07:46 +0000 |
commit | 08ed2a46952a4d294f3c77d1e0d21a2352526bf1 (patch) | |
tree | e320c410830eceede37b090655f6a661d958f9fb /Gui | |
parent | a555841ab15e6d73995376f49aa9c14047348734 (diff) |
10l
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8981 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'Gui')
-rw-r--r-- | Gui/mplayer/gtk/fs.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/Gui/mplayer/gtk/fs.c b/Gui/mplayer/gtk/fs.c index 2f9a68b662..0ae6336ca8 100644 --- a/Gui/mplayer/gtk/fs.c +++ b/Gui/mplayer/gtk/fs.c @@ -151,10 +151,9 @@ void CheckDir( GtkWidget * list,char * directory ) str[0][0]=NULL; pixmap=dpixmap; mask=dmask; - str[0][0]=NULL; str[0][1]=(gchar *)malloc( 3 ); - strcpy( str[0][1],"." ); gtk_clist_append( GTK_CLIST( list ),str[0] ); gtk_clist_set_pixmap( GTK_CLIST( list ),0,0,pixmap,mask ); - strcpy( str[0][1],".." ); gtk_clist_append( GTK_CLIST( list ),str[0] ); gtk_clist_set_pixmap( GTK_CLIST( list ),1,0,pixmap,mask ); - free( str[0][0] ); + str[0][0]=NULL; + str[0][1]="."; gtk_clist_append( GTK_CLIST( list ),str[0] ); gtk_clist_set_pixmap( GTK_CLIST( list ),0,0,pixmap,mask ); + str[0][1]=".."; gtk_clist_append( GTK_CLIST( list ),str[0] ); gtk_clist_set_pixmap( GTK_CLIST( list ),1,0,pixmap,mask ); glob( "*",0,NULL,&gg ); // glob( ".*",GLOB_NOSORT | GLOB_APPEND,NULL,&gg ); @@ -163,12 +162,10 @@ void CheckDir( GtkWidget * list,char * directory ) stat( gg.gl_pathv[i],&fs ); if( !S_ISDIR( fs.st_mode ) ) continue; - str[0][1]=(gchar *)malloc( strlen( gg.gl_pathv[i] ) + 1 ); - strcpy( str[0][1],gg.gl_pathv[i] ); + str[0][1]=gg.gl_pathv[i]; pixmap=dpixmap; mask=dmask; gtk_clist_append( GTK_CLIST( list ),str[0] ); gtk_clist_set_pixmap( GTK_CLIST( list ),c++,0,pixmap,mask ); - free( str[0][1] ); } globfree( &gg ); @@ -213,11 +210,9 @@ void CheckDir( GtkWidget * list,char * directory ) stat( gg.gl_pathv[i],&fs ); if( S_ISDIR( fs.st_mode ) ) continue; - str[0][1]=(gchar *)malloc( strlen( gg.gl_pathv[i] ) + 1 ); - strcpy( str[0][1],gg.gl_pathv[i] ); + str[0][1]=gg.gl_pathv[i]; gtk_clist_append( GTK_CLIST( list ),str[0] ); gtk_clist_set_pixmap( GTK_CLIST( list ),c++,0,pixmap,mask ); - free( str[0][1] ); } globfree( &gg ); |