From: rdparker AT butlermfg DOT org (Parker, Ron) Subject: RE: B20 patch: UNC device path handling 2 Nov 1998 15:50:43 -0800 Message-ID: <199811022306.PAA07146.cygnus.cygwin32.developers@cygnus.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="---- =_NextPart_000_01BE06B6.5F124540" To: Corinna Vinschen , cygwin32-developers AT cygnus DOT com This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------ =_NextPart_000_01BE06B6.5F124540 Content-Type: text/plain FYI, The utility at http://www.sysinternals.com/winobj.htm will show all of the devices on an NT system, which could appear under "\\.\". Click on the "??" key on the left and the devices will display on the right. I would change the patch to: --- path.cc.orig Mon Nov 02 22:24:51 1998 +++ path.cc Mon Nov 02 22:35:36 1998 @@ -697,9 +697,9 @@ mount_info::conv_to_win32_path (const ch int j = mount[i].devicelen; memcpy (p, mount[i].device, j); /* Do not add trailing \ to UNC device names like \\.\a: */ - if (pathbuf[mount[i].pathlen] != '/' && - !(strncmp (mount[i].device, "\\\\.\\", 4) == 0 && - mount[i].device[mount[i].devicelen-1] == ':')) + if (pathbuf[mount[i].pathlen] != '/' && + strncmp (mount[i].device, "\\\\.\\", 4) == 0 && + strchr(mount[i].device[mount[i].devicelen-1] + 4, '\\')) p[j++] = '\\'; strcpy (p + j, pathbuf + mount[i].pathlen); backslashify (p, p, trailing_slash_p); These checks will account for \\.\tape0 and \\.\a: while still adding a trailing slash to \\.\UNC\machine\share_name. The original patch, seen below, would never add a trailing slash to \\.\... style paths. -----Original Message----- From: Corinna Vinschen [mailto:corinna DOT vinschen AT cityweb DOT de] Sent: Monday, November 02, 1998 3:42 PM To: cygwin32-developers AT cygnus DOT com Subject: B20 patch: UNC device path handling Hello, the handling of UNC device paths is incorrect. In the actual version, the path must end with a colon. This ignores the existence of paths like '\\.\tape0' or '\\.\physicaldrive2'. So, leave out the "colon check". Regards, Corinna ---- snip ---- --- path.cc.orig Mon Nov 02 22:24:51 1998 +++ path.cc Mon Nov 02 22:35:36 1998 @@ -697,9 +697,8 @@ mount_info::conv_to_win32_path (const ch int j = mount[i].devicelen; memcpy (p, mount[i].device, j); /* Do not add trailing \ to UNC device names like \\.\a: */ - if (pathbuf[mount[i].pathlen] != '/' && - !(strncmp (mount[i].device, "\\\\.\\", 4) == 0 && - mount[i].device[mount[i].devicelen-1] == ':')) + if (pathbuf[mount[i].pathlen] != '/' + && strncmp (mount[i].device, "\\\\.\\", 4)) p[j++] = '\\'; strcpy (p + j, pathbuf + mount[i].pathlen); backslashify (p, p, trailing_slash_p); ------ =_NextPart_000_01BE06B6.5F124540 Content-Type: application/ms-tnef Content-Transfer-Encoding: base64 eJ8+IhIXAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA5AQAAAAAAADoAAEIgAcAGAAAAElQTS5NaWNy b3NvZnQgTWFpbC5Ob3RlADEIAQSAAQAoAAAAUkU6IEIyMCBwYXRjaDogVU5DIGRldmljZSBwYXRo IGhhbmRsaW5nAMcMAQmAAQAhAAAAMENEMDVENUQxMzcxRDIxMUI5RjAwMDEwNEI4Q0YzRDkAFgcB IIADAA4AAADOBwsAAgARAA0AEAABABEBAQWAAwAOAAAAzgcLAAIAEQAKADEAAQAvAQENgAQAAgAA AAIAAgABA5AGANwKAAAwAAAACwACAAEAAAALACsAAAAAAAMALgAAAAAAQAA5AKAacQe2Br4BHgBw AAEAAAAkAAAAQjIwIHBhdGNoOiBVTkMgZGV2aWNlIHBhdGggaGFuZGxpbmcAAgFxAAEAAAAbAAAA Ab4GrhkdZzGP/nJjEdKANggACeAbgQAAv1kgAAIBCRABAAAAXAUAAFgFAADRCwAATFpGdVqadzYD AAoAcmNwZzEyNeIyA0N0ZXgFQQEDAff/CoACpAPkBxMCgA/zAFAEVj8IVQeyESUOUQMBAgBjaOEK wHNldDIGAAbDESX2MwRGE7cwEiwRMwjvCfe2OxgfDjA1ESIMYGMAULMLCQFkMzYWUAunYwEwACBG WUksIFRoEGUgdXQDEGl0eRQgYQVAaAJAcDovxC93HuAuc3k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