summaryrefslogtreecommitdiff
path: root/src/kmk/w32/pathstuff.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kmk/w32/pathstuff.c')
-rw-r--r--src/kmk/w32/pathstuff.c48
1 files changed, 3 insertions, 45 deletions
diff --git a/src/kmk/w32/pathstuff.c b/src/kmk/w32/pathstuff.c
index eca3f24..8eea494 100644
--- a/src/kmk/w32/pathstuff.c
+++ b/src/kmk/w32/pathstuff.c
@@ -1,6 +1,6 @@
/* Path conversion for Windows pathnames.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-2007, 2009 Free Software Foundation, Inc.
+2007, 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -16,10 +16,9 @@ You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */
#include <Windows.h> /* bird */
-#include <stdio.h> /* bird */
+#include "make.h"
#include <string.h>
#include <stdlib.h>
-#include "make.h"
#include "pathstuff.h"
/*
@@ -82,7 +81,7 @@ convert_Path_to_windows32(char *Path, char to_delim)
if (etok) {
*etok = to_delim;
p = ++etok;
- } else
+ } else
p += strlen(p);
} else {
/* found another one, no drive letter */
@@ -145,47 +144,6 @@ getcwd_fs(char* buf, int len)
return p;
}
-#undef stat
-/*
- * Workaround for directory names with trailing slashes.
- * Added by bird reasons stated.
- */
-int
-my_stat(const char *path, struct stat *st)
-{
- int rc = stat(path, st);
- if ( rc != 0
- && errno == ENOENT
- && *path != '\0')
- {
- char *slash = strchr(path, '\0') - 1;
- if (*slash == '/' || *slash == '\\')
- {
- size_t len_path = slash - path + 1;
- char *tmp = alloca(len_path + 4);
- memcpy(tmp, path, len_path);
- tmp[len_path] = '.';
- tmp[len_path + 1] = '\0';
- errno = 0;
- rc = stat(tmp, st);
- if ( rc == 0
- && !S_ISDIR(st->st_mode))
- {
- errno = ENOTDIR;
- rc = -1;
- }
- }
- }
-#ifdef KMK_PRF
- {
- int err = errno;
- fprintf(stderr, "stat(%s,) -> %d/%d\n", path, rc, errno);
- errno = err;
- }
-#endif
- return rc;
-}
-
#ifdef unused
/*
* Convert delimiter separated pathnames (e.g. PATH) or single file pathname