mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-02 09:31:07 +00:00
Bugfix for expanding tilde.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9668 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
daf706467b
commit
341a616078
2 changed files with 12 additions and 5 deletions
|
@ -10,6 +10,8 @@
|
||||||
* Source/NSObject.m: ([+initialize]) call GSSetLocaleC() after other
|
* Source/NSObject.m: ([+initialize]) call GSSetLocaleC() after other
|
||||||
initialisation, to try to ensure that locale stuff is set up early
|
initialisation, to try to ensure that locale stuff is set up early
|
||||||
before any attempt is made to use locale dependent code.
|
before any attempt is made to use locale dependent code.
|
||||||
|
* Source/NSString.m: ([-stringByExpandingTildeInPath:]) fix suggested
|
||||||
|
by David Wetzel.
|
||||||
|
|
||||||
2001-04-22 Nicola Pero <n.pero@mi.flashnet.it>
|
2001-04-22 Nicola Pero <n.pero@mi.flashnet.it>
|
||||||
|
|
||||||
|
|
|
@ -2555,10 +2555,15 @@ handle_printf_atsign (FILE *stream,
|
||||||
NSString *uname;
|
NSString *uname;
|
||||||
|
|
||||||
if (first_slash_range.length != 0)
|
if (first_slash_range.length != 0)
|
||||||
|
{
|
||||||
uname_len = first_slash_range.length - 1;
|
uname_len = first_slash_range.length - 1;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
/* It is actually of the form `~username' */
|
/* It is actually of the form `~username' */
|
||||||
uname_len = [self length] - 1;
|
uname_len = [self length] - 1;
|
||||||
|
first_slash_range.location = [self length];
|
||||||
|
}
|
||||||
uname = [self substringWithRange: ((NSRange){1, uname_len})];
|
uname = [self substringWithRange: ((NSRange){1, uname_len})];
|
||||||
homedir = NSHomeDirectoryForUser (uname);
|
homedir = NSHomeDirectoryForUser (uname);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue