Hello, I imported regexp from gnulib into grub. Available from people/phcoder/regexp. Following changes required: common.rmk Add: pkglib_MODULES += regexp.mod regexp_mod_SOURCES = gnulib/regex.c commands/regexp.c regexp_mod_CFLAGS = $(COMMON_CFLAGS) -Wno-sign-compare -Wno-unused regexp_mod_LDFLAGS = $(COMMON_LDFLAGS) commands/regexp.c New file (attached) gnulib/regcomp.c, gnulib/regex_internal.c, gnulib/regexec.c: Copied verbatim from gnulib. gnulib/regex.c: New file (attached). Based on file from gnulib, heavily modified gnulib/regex_internal.h. Copied from gnulib following modification needed: --- /home/phcoder/repos/gnulib/lib/regex_internal.h 2009-11-19 14:02:55.406619037 +0100 +++ gnulib/regex_internal.h 2009-12-27 14:28:10.504789886 +0100 @@ -21,33 +21,6 @@ #ifndef _REGEX_INTERNAL_H #define _REGEX_INTERNAL_H 1 -#include -#include -#include -#include -#include -#include - -#ifdef _LIBC -# include -#else -# include "localcharset.h" -#endif -#if defined HAVE_LOCALE_H || defined _LIBC -# include -#endif - -#include -#include -#include -#if defined _LIBC -# include -#else -# define __libc_lock_init(NAME) do { } while (0) -# define __libc_lock_lock(NAME) do { } while (0) -# define __libc_lock_unlock(NAME) do { } while (0) -#endif - /* In case that the system doesn't have isblank(). */ #if !defined _LIBC && ! (defined isblank || (HAVE_ISBLANK && HAVE_DECL_ISBLANK)) # define isblank(ch) ((ch) == ' ' || (ch) == '\t') include/grub/gnulib-wrap.h: New file include/grub/regex.h: Copied from gnulib. Following modification: --- /home/phcoder/repos/gnulib/lib/regex.h 2009-11-19 14:02:55.402619158 +0100 +++ include/grub/regex.h 2009-12-27 14:20:37.356524246 +0100 @@ -21,7 +21,7 @@ #ifndef _REGEX_H #define _REGEX_H 1 -#include +#include /* Allow the use in C++ code. */ #ifdef __cplusplus -- Regards Vladimir 'φ-coder/phcoder' Serbinenko