mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Implemented NSFullUserName()
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4071 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d9deeff908
commit
d1a3e9b9a7
2 changed files with 13 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
Tue Apr 13 21:00:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
* Source/NSUser.m: Implemented NSFullUserName()
|
||||
|
||||
Mon Apr 12 13:15:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
* Source/NSCountedSet.m: Make copying behavior be same as OPENSTEP
|
||||
|
|
|
@ -37,6 +37,8 @@
|
|||
#include <stdlib.h> // for getenv()
|
||||
#if !defined(__WIN32__) && !defined(_WIN32)
|
||||
#include <unistd.h> // for getlogin()
|
||||
#endif
|
||||
#if HAVE_PWD_H
|
||||
#include <pwd.h> // for getpwnam()
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
|
@ -143,8 +145,15 @@ NSHomeDirectoryForUser (NSString *login_name)
|
|||
|
||||
NSString *NSFullUserName(void)
|
||||
{
|
||||
#if HAVE_PWD_H
|
||||
struct passwd *pw;
|
||||
|
||||
pw = getpwnam([NSUserName() cString]);
|
||||
return [NSString stringWithCString: pw->pw_gecos];
|
||||
#else
|
||||
NSLog(@"Warning: NSFullUserName not implemented\n");
|
||||
return NSUserName();
|
||||
#endif
|
||||
}
|
||||
|
||||
NSArray *NSStandardApplicationPaths(void)
|
||||
|
|
Loading…
Reference in a new issue