+2006-07-13 Bruno Haible <bruno@clisp.org>
+
+ Fix construction of temporary directory names on mingw.
+ * tmpdir.c (ISSLASH): New macro.
+ (path_search): Use it, and remove also the first character if it is
+ a slash.
+ Reported by Steffen Macke <sdteffen@gmail.com>.
+
2006-07-13 Bruno Haible <bruno@clisp.org>
* Makefile.am (EXTRA_DIST): Add javaversion.class.
# define __secure_getenv getenv
#endif
+/* Pathname support.
+ ISSLASH(C) tests whether C is a directory separator character.
+ */
+#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
+ /* Win32, Cygwin, OS/2, DOS */
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+#else
+ /* Unix */
+# define ISSLASH(C) ((C) == '/')
+#endif
+
/* Return nonzero if DIR is an existent directory. */
static bool
}
dlen = strlen (dir);
- while (dlen > 1 && dir[dlen - 1] == '/')
+ while (dlen >= 1 && ISSLASH (dir[dlen - 1]))
dlen--; /* remove trailing slashes */
/* check we have room for "${dir}/${pfx}XXXXXX\0" */