delorie.com/archives/browse.cgi | search |
>>I also had a look at the code and reached pretty much the same conclusion >>as Volker. Replacing all 'isslash (*src)' and 'isslash (src[x])' in >>normalize_posix_path by "isdirsep ()" would yield more consistent results. >>I know this code is delicate but the possible drawback isn't obvious. > > speed disadvantage for nebulous gain. I will not comment on the nebulous gain, but it is not necessary at all to use sdirsep () or both '\' and '/' in normalize_posix_path. Just let the function do what its comment says, namely "\'s are converted to /'s in the process." At the moment this is only done when the path either contains a drive letter or is an unc path. This is not done for "normal" DOS paths, IMHO consistency would require that all remaining "\" are converted to "/" for all paths. Isn't this what normalize_posix_path is meant to do? I.e. put: --- snip --- for (char *p = dst; (p = strchr (p, '\\')); p++) *p = '/'; --- snap --- in line 212 in path.cc before the remaing cases are evaluated. Volker -- PGP/GPG key (ID: 0x9F8A785D) available from wwwkeys.de.pgp.net key-fingerprint 550D F17E B082 A3E9 F913 9E53 3D35 C9BA 9F8A 785D -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |