bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

base (mingw32): [NSFileManager fileSystemRepresentationWithPath:]


From: Michael Scheibler
Subject: base (mingw32): [NSFileManager fileSystemRepresentationWithPath:]
Date: Wed, 11 Jul 2001 11:13:40 +0200

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]