two bugs:
- missing null pointer checking
- no support for UNC paths
here's the cvs diff for a bugfix:
< if (c_path[0] == '/' && c_path[1] == '/' && isalpha(c_path[2]))
---
> int len = [newpath length];
> if (c_path == 0)
> return 0;
> if (len >= 3 && c_path[0] == '/' && c_path[1] == '/' &&
isalpha(c_path[2]))
(snip)
< /* Cygwin "//c/" type absolute path */
< newpath = [NSString stringWithFormat: @"%c:%s", c_path[2],
&c_path[3]];
< newpath = [newpath stringByReplacingString: @"/" withString: @"\\"];
---
> if (len == 3 || c_path[3] == '/')
> {
> /* Cygwin "//c/" type absolute path */
> newpath = [NSString stringWithFormat: @"%c:%s", c_path[2],
&c_path[3
]];
> newpath = [newpath stringByReplacingString: @"/" withString:
@"\\"];
> }
> else
> {
> /* Windows absolute UNC path "//name/" */
> newpath = [newpath stringByReplacingString: @"/" withString:
@"\\"];
> }
Michael Scheibler
_______________________________________________
Bug-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gnustep