Update of /cvsroot/plib/plib/src/pui
In directory usw-pr-cvs1:/tmp/cvs-serv25237
Modified Files:
puFileSelector.cxx
Log Message:
Fixed bug in puFileSelector (thanks to Dave McClurg and Julian Foad
Index: puFileSelector.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/pui/puFileSelector.cxx,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- puFileSelector.cxx 20 Jun 2002 20:07:53 -0000 1.24
+++ puFileSelector.cxx 7 Jul 2002 19:05:56 -0000 1.25
@@ -610,28 +610,30 @@
return ;
}
- for ( ifile = 0 ;
- (dp = ulReadDir(dirp)) != NULL && ifile < num_files ;
- ifile++ )
+ ifile = 0 ;
+
+ while ( (dp = ulReadDir(dirp)) != NULL && ifile < num_files )
{
/* Skip over the "." entry... */
- if ( strcmp ( dp->d_name, "." ) == 0 )
- continue ;
+ if ( strcmp ( dp->d_name, "." ) != 0 )
+ {
+ dflag[ ifile ] = dp->d_isdir ;
- dflag[ ifile ] = dp->d_isdir ;
+ if ( dflag[ ifile ] )
+ {
+ files[ ifile ] = new char[ strlen(dp->d_name)+4 ] ;
+ strcpy ( files [ ifile ], "[" ) ;
+ strcat ( files [ ifile ], dp->d_name ) ;
+ strcat ( files [ ifile ], "]" ) ;
+ }
+ else
+ {
+ files[ ifile ] = new char[ strlen(dp->d_name)+1 ] ;
+ strcpy ( files [ ifile ], dp->d_name ) ;
+ }
- if ( dflag[ ifile ] )
- {
- files[ ifile ] = new char[ strlen(dp->d_name)+4 ] ;
- strcpy ( files [ ifile ], "[" ) ;
- strcat ( files [ ifile ], dp->d_name ) ;
- strcat ( files [ ifile ], "]" ) ;
- }
- else
- {
- files[ ifile ] = new char[ strlen(dp->d_name)+1 ] ;
- strcpy ( files [ ifile ], dp->d_name ) ;
+ ifile++ ;
}
}
|