mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-20 16:01:10 +08:00
* lib/getopt.c: Use __progname==__argv[0] when not compiling for cygwin.
* scandir.cc (scandir): Use correct default when compar == NULL.
This commit is contained in:
parent
487fb5f1c4
commit
596f3269b0
@ -1,3 +1,9 @@
|
||||
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
|
||||
|
@ -68,6 +68,9 @@ char *optarg; /* argument associated with option */
|
||||
__weak_alias(getopt_long,_getopt_long)
|
||||
#endif
|
||||
|
||||
#ifndef __CYGWIN__
|
||||
#define __progname __argv[0]
|
||||
#endif
|
||||
|
||||
#define IGNORE_FIRST (*options == '-' || *options == '+')
|
||||
#define PRINT_ERROR ((opterr) && ((*options != ':') \
|
||||
|
@ -16,8 +16,13 @@
|
||||
#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 *),
|
||||
@ -33,6 +38,8 @@ scandir (const char *dir,
|
||||
|
||||
int prior_errno = get_errno ();
|
||||
set_errno (0);
|
||||
if (!compar)
|
||||
compar = alphasort;
|
||||
|
||||
while ((ent = readdir (dirp)))
|
||||
{
|
||||
@ -91,11 +98,3 @@ scandir (const char *dir,
|
||||
*namelist = nl;
|
||||
return count;
|
||||
}
|
||||
|
||||
extern "C"
|
||||
int
|
||||
alphasort (const struct dirent **a, const struct dirent **b)
|
||||
{
|
||||
return strcoll ((*a)->d_name, (*b)->d_name);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user