OSDN Git Service

Work around Microsoft breakage of command line globbing.
authorEarnie Boyd <earnie@users.sourceforge.net>
Wed, 31 Oct 2012 13:56:04 +0000 (09:56 -0400)
committerEarnie Boyd <earnie@users.sourceforge.net>
Wed, 31 Oct 2012 13:56:04 +0000 (09:56 -0400)
commit9175ca5e7c8f1f19abfae460d831e48161b07946
tree92f0bf5e53b78b5df7259db7f906f36d9974db88
parentbd5f94818b747ebc066e7e367110b468c4884a07
Work around Microsoft breakage of command line globbing.

* include/glob.h: New file; it declares the API for a (mostly) POSIX
compatible path name globbing facility for use in MinGW applications.

* src/libcrt/misc/glob.c: New file; it implements the glob API...
(__mingw_glob, __mingw_globfree): ...through this pair of functions.

* Makefile.in (misc_SOURCES): Add glob.c
(mingwrt_lib_INCLUDES): Add glob.h

* include/_mingw.h (BEGIN_C_DECLS, END_C_DECLS): New macros;
they facilitate...
[__cplusplus]: ...demarcation of 'extern "C"' declarations for this.
(__CRT_GLOB_ESCAPE_CHAR__): New manifest constant; define it.
(__CRT_GLOB_USE_MSVCRT__, __CRT_GLOB_USE_MINGW__): Likewise; these act
as mutually exclusive feature selectors for assignment in CRTglob.c
(__CRT_GLOB_USE_SINGLE_QUOTE__, __CRT_GLOB_BRACKET_GROUPS__):
(__CRT_GLOB_CASE_SENSITIVE__): New bit-flag definitions; with...
[_CRT_glob & __CRT_GLOB_USE_MINGW__]: ...they enable additional
command line globbing capabilities.

* src/libcrt/crt/CRTglob.c (_CRT_glob): New default value; enable...
[_CRT_glob & __CRT_GLOB_USE_MINGW__]: ...this feature preference.

* src/libcrt/crt/init.c (_CRT_GLOB_OPT, ARGV_INLINE): New macros.
(ARGV_ESCAPE, ARGV_SQUOTE, ARGV_NOGROUP): New manifest constants;
define them as aliases for the new bit-flags from _mingw.h
(do_glob, backslash, unquote, __mingw_setargv): New static functions.
(_mingw32_init_mainargs): Use them to implement globbing, when...
[_CRT_glob & __CRT_GLOB_USE_MINGW__]: ...this is enabled.
ChangeLog
Makefile.in
include/_mingw.h
include/glob.h [new file with mode: 0644]
src/libcrt/crt/CRTglob.c
src/libcrt/crt/init.c
src/libcrt/misc/glob.c [new file with mode: 0644]