]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Better support for DOS-like systems.
authorBruno Haible <bruno@clisp.org>
Wed, 2 Jan 2002 11:06:23 +0000 (11:06 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 21 Jun 2009 22:29:22 +0000 (00:29 +0200)
intl/ChangeLog
intl/localcharset.c
lib/ChangeLog
lib/basename.c
lib/localcharset.c

index bf51c0a21ea59ac9139bfa33de88e93acdcb4e95..d4b69aaacd05b5ef112227630e0b9d69d9eec89a 100644 (file)
@@ -1,3 +1,7 @@
+2001-12-21  Bruno Haible  <bruno@clisp.org>
+
+       * localcharset.c (ISSLASH): Provide definition for DOS-like systems.
+
 2001-12-21  Bruno Haible  <bruno@clisp.org>
 
        * libgettext.h: Moved to ../lib/gettext.h.
index 17365f1d39061672309a96e0a6ab9d7eb54db348..624a808b5c6b5a11c081cd919014ebe016f532e0 100644 (file)
 # include <os2.h>
 #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
index a62960f63d875ff2a1538a1c3f75e09810cc3a4d..d0a995d576ee70a459d46f0766f05a9a491b9dbf 100644 (file)
@@ -1,3 +1,8 @@
+2001-12-21  Bruno Haible  <bruno@clisp.org>
+
+       * localcharset.c (ISSLASH): Provide definition for DOS-like systems.
+       * basename.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
+
 2001-12-22  Bruno Haible  <bruno@clisp.org>
 
        * binary-io.h: New file, extracted from system.h.
index 578c1772af6341c9e56f70345e5c705ed813b8e9..9a4f3400194ba637513dbdd553555e13db4307c5 100644 (file)
 #include <stdio.h>
 #include <assert.h>
 
+#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
index 17365f1d39061672309a96e0a6ab9d7eb54db348..624a808b5c6b5a11c081cd919014ebe016f532e0 100644 (file)
 # include <os2.h>
 #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