aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorTomas Ogren <stric@ing.umu.se>1999-02-20 08:23:40 +0800
committerTomas Ă–gren <stric@src.gnome.org>1999-02-20 08:23:40 +0800
commit7b064036dca14df26dc6f240307f49f909b35e00 (patch)
tree35195d531b6f101bf79fe21a6ae5f3dcd380ea7b /calendar
parentb9fed505034f00b70ef8e619ec12e62bde0877ed (diff)
downloadgsoc2013-evolution-7b064036dca14df26dc6f240307f49f909b35e00.tar.gz
gsoc2013-evolution-7b064036dca14df26dc6f240307f49f909b35e00.tar.zst
gsoc2013-evolution-7b064036dca14df26dc6f240307f49f909b35e00.zip
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
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog5
-rw-r--r--calendar/gui/main.c26
-rw-r--r--calendar/main.c26
3 files changed, 9 insertions, 48 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 3527356303..c3be35257a 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -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,
diff --git a/calendar/gui/main.c b/calendar/gui/main.c
index c5c4696ef9..0d572277ba 100644
--- a/calendar/gui/main.c
+++ b/calendar/gui/main.c
@@ -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
diff --git a/calendar/main.c b/calendar/main.c
index c5c4696ef9..0d572277ba 100644
--- a/calendar/main.c
+++ b/calendar/main.c
@@ -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