Mail Archives: djgpp-workers/1999/08/31/23:47:27
> What case, exactly, do you want to fix?
>
The patch below prevents 'c:\\\foo\bar' or 'c:/\/foo\bar' from being interpreted as
a UNC while not interfering with '\\foo\bar'.
*** src/libc/dos/io/putpath.c.orig Thu Jun 3 13:27:34 1999
--- src/libc/dos/io/putpath.c Tue Aug 31 23:17:14 1999
*************** _put_path2(const char *path, int offset)
*** 144,149 ****
--- 144,170 ----
path = p + 5;
}
+ /* Collapse multiple slashes and backslashes to a single slash
+ after a drive letter and colon so DOS will not mistakenly
+ interpret them as a network request. */
+ if (*path && path[1] == ':' && (path[2] == '/' || path[2] == '\\'))
+ {
+ _farnspokeb(o, *path);
+ ++o;
+ ++path;
+
+ _farnspokeb(o, *path);
+ ++o;
+ ++path;
+
+ _farnspokeb(o, *path);
+ ++o;
+ ++path;
+
+ while (*path == '/' || *path == '\\')
+ ++path;
+ }
+
/* collapse multiple slashes to a single slash */
for (; *path; path++)
{
----------------
I also discovered while testing the changes that _put_path gets called three times
when using _fixpath. One call is in _fixpath, another in _use_lfn, and yet another
in _get_volume_info. It's certainly a waste to do the same thing three times, but I
don't see offhand what can be done about it.
---
Mark Elbrecht, snowball3 AT bigfoot DOT com
http://snowball.frogspace.net/
- Raw text -