--- function.c 2006-04-01 11:36:40.000000000 +0400 +++ function.c.fixed 2008-06-26 14:23:24.000000000 +0400 @@ -1883,13 +1883,18 @@ { char *dest; const char *start, *end, *apath_limit; + int prefix_offset = 1; if (name[0] == '\0' || apath == NULL) return NULL; apath_limit = apath + GET_PATH_MAX; - if (name[0] != '/') + if (name[0] != '/' +#ifdef WINDOWS32 + && name[1] != ':' +#endif + ) { /* It is unlikely we would make it until here but just to make sure. */ if (!starting_directory) @@ -1901,8 +1906,22 @@ } else { - apath[0] = '/'; - dest = apath + 1; +#ifdef WINDOWS32 + if(name[1] == ':') + { + apath[0] = name[0]; + apath[1] = ':'; + apath[2] = '/'; + dest = apath + 3; + prefix_offset = 3; + name += 2; + } + else +#endif + { + apath[0] = '/'; + dest = apath + 1; + } } for (start = end = name; *start != '\0'; start = end) @@ -1926,7 +1945,7 @@ else if (len == 2 && start[0] == '.' && start[1] == '.') { /* Back up to previous component, ignore if at root already. */ - if (dest > apath + 1) + if (dest > apath + prefix_offset) while ((--dest)[-1] != '/'); } else