Made use of g_get_{user,real}_name() instead of our own home-brew...

1999-02-20  Tomas Ogren  <stric@ing.umu.se>

* main.c (init_username): Made use of g_get_{user,real}_name() instead
of our own home-brew...

svn path=/trunk/; revision=679
This commit is contained in:
Tomas Ogren
1999-02-20 00:23:40 +00:00
committed by Tomas Ögren
parent b9fed50503
commit 7b064036dc
3 changed files with 9 additions and 48 deletions

View File

@ -1,3 +1,8 @@
1999-02-20 Tomas Ogren <stric@ing.umu.se>
* main.c (init_username): Made use of g_get_{user,real}_name() instead
of our own home-brew...
1999-02-17 Sergey Panov <sipan@mit.edu>
* gnome-month-item.c,gnome-month-item.h,goto.c,mark.h,

View File

@ -79,30 +79,8 @@ static int show_events;
static void
init_username (void)
{
char *p;
struct passwd *passwd;
passwd = getpwuid (getuid ());
if ((p = passwd->pw_name)) {
char *comma;
user_name = g_strdup (p);
full_name = g_strdup (passwd->pw_gecos);
/* Keep only the name from the gecos field */
if ((comma = strchr (full_name, ',')) != NULL)
*comma = 0;
} else {
if ((p = getenv ("USER"))) {
user_name = g_strdup (p);
full_name = g_strdup (p);
return;
} else {
user_name = g_strdup ("unknown");
full_name = g_strdup ("unknown");
}
}
endpwent ();
user_name = g_strdup(g_get_user_name());
full_name = g_strdup(g_get_real_name());
}
static int

View File

@ -79,30 +79,8 @@ static int show_events;
static void
init_username (void)
{
char *p;
struct passwd *passwd;
passwd = getpwuid (getuid ());
if ((p = passwd->pw_name)) {
char *comma;
user_name = g_strdup (p);
full_name = g_strdup (passwd->pw_gecos);
/* Keep only the name from the gecos field */
if ((comma = strchr (full_name, ',')) != NULL)
*comma = 0;
} else {
if ((p = getenv ("USER"))) {
user_name = g_strdup (p);
full_name = g_strdup (p);
return;
} else {
user_name = g_strdup ("unknown");
full_name = g_strdup ("unknown");
}
}
endpwent ();
user_name = g_strdup(g_get_user_name());
full_name = g_strdup(g_get_real_name());
}
static int