Added MINGW fixes for path handling

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9426 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2001-03-17 11:45:37 +00:00
parent fe9eae5ffa
commit 6bf539ef2c
2 changed files with 41 additions and 7 deletions

View file

@ -1,8 +1,11 @@
2001-03-17 Richard Frith-Macdonald <rfm@gnu.org>
* Headers/Foundation/NSThread.h: Remove unused ivar.
* Source/NSThread.m: Revise scheme for deallocation of thread
dictionary ... keep it operating to avoid problems with stuff
trying to use it while deing deallocated. Log memory leaks.
* Source/NSString.m: MINGW path handling fixes by Michael Scheibler
stringByAppendingPath, isAbsolurtePath, and stringByStandardizingPath.
2001-03-16 Nicola Pero <n.pero@mi.flashnet.it>

View file

@ -2326,8 +2326,14 @@ handle_printf_atsign (FILE *stream,
}
if (length > 0)
{
#if defined(__MINGW__)
#define _PATH_SEARCH_END 1
#else
#define _PATH_SEARCH_END 0
#endif
aLength = length - 1;
while (aLength > 0)
while (aLength > _PATH_SEARCH_END)
#undef _PATH_SEARCH_END
{
if (pathSepMember(buf[aLength]) == YES)
{
@ -2621,7 +2627,18 @@ handle_printf_atsign (FILE *stream,
if (r.location + r.length + 1 <= length
&& pathSepMember((*caiImp)(s, caiSel, r.location + 1)) == YES)
{
#if defined(__MINGW__)
if (r.location)
{
[s deleteCharactersInRange: r];
}
else
{
r.location++;
}
#else
[s deleteCharactersInRange: r];
#endif /* (__MINGW__) */
}
else if (r.location + r.length + 2 <= length
&& (*caiImp)(s, caiSel, r.location + 1) == (unichar)'.'
@ -2730,25 +2747,39 @@ handle_printf_atsign (FILE *stream,
- (BOOL) isAbsolutePath
{
if ([self length] == 0)
return NO;
{
return NO;
}
#if defined(__MINGW__)
if ([self indexOfString: @":"] == NSNotFound)
{
const char *cpath = [self fileSystemRepresentation];
if (isalpha(cpath[0]) && cpath[1] == ':')
return YES;
{
return YES;
}
else if (cpath[0] == cpath[1]
&& (cpath[0] == '/' || cpath[0] == '\\'))
{
return YES;
}
else
return NO;
{
return NO;
}
}
else
return YES;
{
return YES;
}
#else
{
unichar c = [self characterAtIndex: 0];
if (c == (unichar)'/' || c == (unichar)'~')
return YES;
{
return YES;
}
}
#endif
return NO;