mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
fixes for tilde handling on windows
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39466 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b1bc2f8af7
commit
9fbe3bafef
3 changed files with 13 additions and 3 deletions
|
@ -1719,7 +1719,7 @@ NSUserName(void)
|
|||
NSString *
|
||||
NSHomeDirectory(void)
|
||||
{
|
||||
return NSHomeDirectoryForUser (NSUserName ());
|
||||
return NSHomeDirectoryForUser(NSUserName());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1810,6 +1810,10 @@ NSHomeDirectoryForUser(NSString *loginName)
|
|||
fprintf(stderr, "NSHomeDirectoryForUser(%s) failed.\n",
|
||||
[loginName UTF8String]);
|
||||
}
|
||||
if (nil != s)
|
||||
{
|
||||
s = [s stringByStandardizingPath];
|
||||
}
|
||||
#endif
|
||||
return s;
|
||||
}
|
||||
|
@ -2094,7 +2098,7 @@ NSOpenStepRootDirectory(void)
|
|||
#if defined(__CYGWIN__)
|
||||
root = @"/cygdrive/c/";
|
||||
#elif defined(__MINGW__)
|
||||
root = @"C:\\";
|
||||
root = @"C:/";
|
||||
#else
|
||||
root = @"/";
|
||||
#endif
|
||||
|
|
|
@ -4729,12 +4729,13 @@ static NSFileManager *fm = nil;
|
|||
|
||||
- (NSString*) stringByAbbreviatingWithTildeInPath
|
||||
{
|
||||
NSString *homedir = NSHomeDirectory ();
|
||||
NSString *homedir;
|
||||
|
||||
if (YES == [self hasPrefix: @"~"])
|
||||
{
|
||||
return IMMUTABLE(self);
|
||||
}
|
||||
homedir = NSHomeDirectory();
|
||||
if (NO == [self hasPrefix: homedir])
|
||||
{
|
||||
/* OSX compatibility ... we clean up the path to try to get a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue