Mail Archives: djgpp-workers/2002/06/30/00:33:32
Looking in put_path we see:
if (strncmp(p, "/dev/", 5) == 0)
{
if (strcmp(p+5, "null") == 0)
path = "nul";
else if (strcmp(p+5, "tty") == 0)
path = "con";
else if (strcmp(p+5, "env") == 0)
/* Keep as is to avoid referencing an 'env' directory in CWD */
;
else if (((p[5] >= 'a' && p[5] <= 'z')
|| (p[5] >= 'A' && p[5] <= 'Z'))
&& (p[6] == '/' || p[6] == '\\' || p[6] == '\0'))
{
/* map /dev/a/ to a:/ */
... snip
}
else if (strncmp(p+5, "env", 3) == 0
&& (p[8] == '/' || p[8] == '\\') && p[9])
{
/* /dev/env/FOO/bar: expand env var FOO and generate %FOO%/bar */
... snip
}
else if (p[5])
path = p + 5;
If we removed the last 2 lines, we would not strip /dev from the start of
strings in put_path if we did not recognize the /dev device - which would
allow us to handle a real /dev directory in a more standard manner.
Is there a reason to strip /dev/ from the start of the string if we don't
recognize the device type?
I'm trying to fix the bug with people who use DJGPP toolkit with a \dev
directory. You couldn't have files/directories which included our
reserved names, but anything else would be transparent.
- Raw text -