Author: sanel.z
Date: 2007-06-01 09:13:08 -0400 (Fri, 01 Jun 2007)
New Revision: 5866
Log:
STR #1355 closed thanks to fisch


Modified:
   trunk/src/filename_list.cxx

Modified: trunk/src/filename_list.cxx
===================================================================
--- trunk/src/filename_list.cxx 2007-06-01 13:04:19 UTC (rev 5865)
+++ trunk/src/filename_list.cxx 2007-06-01 13:13:08 UTC (rev 5866)
@@ -62,7 +62,7 @@
   // This version is when we define our own scandir (WIN32 and perhaps
   // some Unix systems):
   int n = scandir(d, list, 0, sort);
-#elif defined(__linux)
+#elif defined(__linux) || defined (__FreeBSD__) || defined (__NetBSD__)
   int n = scandir(d, list, 0, (int(*)(const void*,const void*))sort);
 #elif defined(__hpux) || defined(__CYGWIN__)
   // HP-UX, Cygwin define the comparison function like this:
@@ -80,35 +80,6 @@
   int n = scandir(d, list, 0, (int(*)(const void*,const void*))sort);
 #endif
 
-#if 0 // Add a slash to all directories...
-#if defined(WIN32) && !defined(__CYGWIN__)
-  // we did this already during fl_scandir/win32
-  // WAS: no it isn't!
-#else
-  // append a '/' to all filenames that are directories
-  int i, dirlen = strlen(d);
-  char *fullname = (char*)malloc(dirlen+PATH_MAX+3); // Add enough extra for 
two /'s and a nul
-  // Use memcpy for speed since we already know the length of the string...
-  memcpy(fullname, d, dirlen+1);
-  char *name = fullname + dirlen;
-  if (name!=fullname && name[-1]!='/') *name++ = '/';
-  for (i=0; i<n; i++) {
-    dirent *de = (*list)[i];
-    int len = strlen(de->d_name);
-    if (de->d_name[len-1]=='/' || len>PATH_MAX) continue;
-    // Use memcpy for speed since we already know the length of the string...
-    memcpy(name, de->d_name, len+1);
-    if (fltk::filename_isdir(fullname)) {
-      (*list)[i] = de = (dirent*)realloc(de, de->d_name - (char*)de + len + 2);
-      char *dst = de->d_name + len;
-      *dst++ = '/';
-      *dst = 0;
-    }
-  }
-  free(fullname);
-#endif
-#endif
-
   return n;
 }
 

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to