+Wed Sep 19 11:52:42 2001 Christopher Faylor <cgf@cygnus.com>
+
+ * lib/getopt.c: Use __progname==__argv[0] when not compiling for cygwin.
+
+ * scandir.cc (scandir): Use correct default when compar == NULL.
+
Wed Sep 19 17:49:00 2001 Corinna Vinschen <corinna@vinschen.de>
* fhandler_socket.cc (fhandler_socket::fhandler_socket): Revert
__weak_alias(getopt_long,_getopt_long)
#endif
+#ifndef __CYGWIN__
+#define __progname __argv[0]
+#endif
#define IGNORE_FIRST (*options == '-' || *options == '+')
#define PRINT_ERROR ((opterr) && ((*options != ':') \
#include <errno.h>
#include "cygerrno.h"
-extern "C"
-int
+extern "C" int
+alphasort (const struct dirent **a, const struct dirent **b)
+{
+ return strcoll ((*a)->d_name, (*b)->d_name);
+}
+
+extern "C" int
scandir (const char *dir,
struct dirent ***namelist,
int (*select) (const struct dirent *),
int prior_errno = get_errno ();
set_errno (0);
+ if (!compar)
+ compar = alphasort;
while ((ent = readdir (dirp)))
{
*namelist = nl;
return count;
}
-
-extern "C"
-int
-alphasort (const struct dirent **a, const struct dirent **b)
-{
- return strcoll ((*a)->d_name, (*b)->d_name);
-}
-