summaryrefslogtreecommitdiff
path: root/w32
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2009-03-14 16:31:57 +0000
committerEli Zaretskii <eliz@gnu.org>2009-03-14 16:31:57 +0000
commit3fd62c76c261e10658a1ba365710ee26b6fb34fe (patch)
tree7a6adf44ce044b1b1e3babf3b1a7968110e9d2a6 /w32
parent27ef86f6b1caa78cefabc632dfbbe78bf7aa56d6 (diff)
downloadgunmake-3fd62c76c261e10658a1ba365710ee26b6fb34fe.tar.gz
(convert_Path_to_windows32): Fix last change. Fixes Savannah bug #25412.
Diffstat (limited to 'w32')
-rw-r--r--w32/pathstuff.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/w32/pathstuff.c b/w32/pathstuff.c
index 6f712d1..bb790f0 100644
--- a/w32/pathstuff.c
+++ b/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 Free Software Foundation, Inc.
+2007, 2009 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
@@ -49,6 +49,9 @@ convert_Path_to_windows32(char *Path, char to_delim)
char *p; /* points to element of old Path */
/* is this a multi-element Path ? */
+ /* FIXME: Perhaps use ":;\"" in strpbrk to convert all quotes to
+ delimiters as well, as a way to handle quoted directories in
+ PATH? */
for (p = Path, etok = strpbrk(p, ":;");
etok;
etok = strpbrk(p, ":;"))
@@ -74,8 +77,11 @@ convert_Path_to_windows32(char *Path, char to_delim)
for (p++; *p && *p != '"'; p++) /* skip quoted part */
;
etok = strpbrk(p, ":;"); /* find next delimiter */
- *etok = to_delim;
- p = ++etok;
+ if (etok) {
+ *etok = to_delim;
+ p = ++etok;
+ } else
+ p += strlen(p);
} else {
/* found another one, no drive letter */
*etok = to_delim;