There is a bug in gnustep-base of not being able to deal with UNC pathes correctly on windows.
Since a while all pathes are converted to an internal format, this applies especially for windows pathes. But the functions in NSString/NSFileManager dealing with this are having problems with direct UNC pathes...
So imagine a path \\server\share\some\more\pathcomponents
Currently this is transformed to /server/share/some/more/pathcomponents if it is transformed back again it gets converted to \server\share\some\more\pathcomponents. Missing an initial backslash and nothing works anymore on windows.
My applied patch fixes this in NSString.m and NSFileManger.m by leaving an additional / in front of the internal representation.
Roland
--- NSFileManager.m.orig 2003-07-21 14:23:04.000000000 +0200
+++ NSFileManager.m 2003-07-18 16:44:15.000000000 +0200
@@ -1852,7 +1852,7 @@
i = 0;
}
/*
- * Convert backslashes to slashes, colaescing adjacent slashses.
+ * Convert backslashes to slashes, colaescing adjacent slashses, but preserve
double // for UNC path
* Also elide '/./' sequences, because we can do so efficiently.
*/
j = i;
@@ -1860,7 +1860,7 @@
{
if (ptr[i] == '\\')
{
- if (j == 0 || buf[j-1] != '/')
+ if (j < 2 || buf[j-1] != '/')
{
if (j > 2 && buf[j-2] == '/' && buf[j-1] == '.')
{
--- NSString.m.orig 2003-07-21 14:22:53.000000000 +0200
+++ NSString.m 2003-07-18 16:44:15.000000000 +0200
@@ -3367,6 +3367,7 @@
{
NSMutableString *s;
NSRange r;
+ int length;
unichar (*caiImp)(NSString*, SEL, unsigned int);
/* Expand `~' in the path */
@@ -3374,7 +3375,16 @@
caiImp = (unichar (*)())[s methodForSelector: caiSel];
/* Condense `//' and '/./' */
- r = NSMakeRange(0, [s length]);
+ length = [s length];
+ r = NSMakeRange(0, length);
+#if defined(__MINGW__)
+ /* Skip first char on mingw to allow UNC Pathes */
+ if (length > 0)
+ {
+ r.location++;
+ r.length--;
+ }
+#endif
while ((r = [s rangeOfCharacterFromSet: pathSeps()
options: 0
range: r]).length)
_______________________________________________ Bug-gnustep mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-gnustep
