mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +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
9792d39ba3
commit
de26bd5c15
2 changed files with 12 additions and 5 deletions
|
@ -2551,14 +2551,19 @@ handle_printf_atsign (FILE *stream,
|
|||
if (first_slash_range.location != 1)
|
||||
{
|
||||
/* It is of the form `~username/blah/...' */
|
||||
int uname_len;
|
||||
NSString *uname;
|
||||
int uname_len;
|
||||
NSString *uname;
|
||||
|
||||
if (first_slash_range.length != 0)
|
||||
uname_len = first_slash_range.length - 1;
|
||||
{
|
||||
uname_len = first_slash_range.length - 1;
|
||||
}
|
||||
else
|
||||
/* It is actually of the form `~username' */
|
||||
uname_len = [self length] - 1;
|
||||
{
|
||||
/* It is actually of the form `~username' */
|
||||
uname_len = [self length] - 1;
|
||||
first_slash_range.location = [self length];
|
||||
}
|
||||
uname = [self substringWithRange: ((NSRange){1, uname_len})];
|
||||
homedir = NSHomeDirectoryForUser (uname);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue