2009-02-16 01:14:51 +01:00
|
|
|
Index: src/vpinit.c
|
|
|
|
===================================================================
|
|
|
|
--- src/vpinit.c.orig
|
2007-01-16 00:08:09 +01:00
|
|
|
+++ src/vpinit.c
|
2009-02-16 01:14:51 +01:00
|
|
|
@@ -111,7 +111,13 @@ vpinit(char *current_dir)
|
|
|
|
vpath = my_strdup(vpath);
|
2007-01-16 00:08:09 +01:00
|
|
|
|
|
|
|
/* split the view path into nodes */
|
|
|
|
- for (i = 0, s = vpath; *s != '\0'; ++i) {
|
|
|
|
+ /* handle VPATH=":foo" */
|
|
|
|
+ i = 0;
|
|
|
|
+ s = vpath;
|
|
|
|
+ while (*s++ == ':') {
|
|
|
|
+ vpdirs[i++] = ".";
|
|
|
|
+ }
|
|
|
|
+ for (; *s != '\0'; ++i) {
|
|
|
|
vpdirs[i] = s;
|
|
|
|
while (*s != '\0' && *++s != ':') {
|
|
|
|
if (*s == '\n') {
|
2009-02-16 01:14:51 +01:00
|
|
|
@@ -119,6 +125,16 @@ vpinit(char *current_dir)
|
2007-01-16 00:08:09 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (*s != '\0') {
|
|
|
|
+ /* handle VPATH="foo:" and VPATH="foo::bar" */
|
|
|
|
+ if (s[1] == '\0' || s[1] == ':') {
|
|
|
|
+ while (s[1] != '\0' && s[1] == ':') {
|
|
|
|
+ vpdirs[++i] = ".";
|
|
|
|
+ *s++ = '\0';
|
|
|
|
+ }
|
|
|
|
+ if (s[1] == '\0') {
|
|
|
|
+ vpdirs[++i] = ".";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
*s++ = '\0';
|
|
|
|
}
|
|
|
|
}
|