From: Bruno Haible Date: Wed, 2 Jan 2002 11:06:23 +0000 (+0000) Subject: Better support for DOS-like systems. X-Git-Tag: v0.11~139 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=337c1d83449465012744c7e7b4e1e198fd9d71ee;p=thirdparty%2Fgettext.git Better support for DOS-like systems. --- diff --git a/intl/ChangeLog b/intl/ChangeLog index bf51c0a21..d4b69aaac 100644 --- a/intl/ChangeLog +++ b/intl/ChangeLog @@ -1,3 +1,7 @@ +2001-12-21 Bruno Haible + + * localcharset.c (ISSLASH): Provide definition for DOS-like systems. + 2001-12-21 Bruno Haible * libgettext.h: Moved to ../lib/gettext.h. diff --git a/intl/localcharset.c b/intl/localcharset.c index 17365f1d3..624a808b5 100644 --- a/intl/localcharset.c +++ b/intl/localcharset.c @@ -63,6 +63,11 @@ # include #endif +#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ + /* Win32, OS/2, DOS */ +# define ISSLASH(C) ((C) == '/' || (C) == '\\') +#endif + #ifndef DIRECTORY_SEPARATOR # define DIRECTORY_SEPARATOR '/' #endif diff --git a/lib/ChangeLog b/lib/ChangeLog index a62960f63..d0a995d57 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2001-12-21 Bruno Haible + + * localcharset.c (ISSLASH): Provide definition for DOS-like systems. + * basename.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise. + 2001-12-22 Bruno Haible * binary-io.h: New file, extracted from system.h. diff --git a/lib/basename.c b/lib/basename.c index 578c1772a..9a4f34001 100644 --- a/lib/basename.c +++ b/lib/basename.c @@ -31,6 +31,15 @@ #include #include +#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ + /* Win32, OS/2, DOS */ +# define HAS_DEVICE(P) \ + ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ + && (P)[1] == ':') +# define FILESYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0) +# define ISSLASH(C) ((C) == '/' || (C) == '\\') +#endif + #ifndef FILESYSTEM_PREFIX_LEN # define FILESYSTEM_PREFIX_LEN(Filename) 0 #endif diff --git a/lib/localcharset.c b/lib/localcharset.c index 17365f1d3..624a808b5 100644 --- a/lib/localcharset.c +++ b/lib/localcharset.c @@ -63,6 +63,11 @@ # include #endif +#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ + /* Win32, OS/2, DOS */ +# define ISSLASH(C) ((C) == '/' || (C) == '\\') +#endif + #ifndef DIRECTORY_SEPARATOR # define DIRECTORY_SEPARATOR '/' #endif