[Mplayer-cvslog] CVS: main/Gui/mplayer/gtk fs.c,1.40,1.41

Zoltan Ponekker pontscho at mplayerhq.hu
Sat Jan 18 02:07:49 CET 2003


Update of /cvsroot/mplayer/main/Gui/mplayer/gtk
In directory mail:/var/tmp.root/cvs-serv24094

Modified Files:
	fs.c 
Log Message:
10l

Index: fs.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/gtk/fs.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- fs.c	2 Jan 2003 15:48:29 -0000	1.40
+++ fs.c	18 Jan 2003 01:07:46 -0000	1.41
@@ -151,10 +151,9 @@
  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 @@
    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 @@
    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 );
 



More information about the MPlayer-cvslog mailing list