Don't treat the Win32 user name like a gecos field, and when extracting a

Thu Jan 22 00:41:34 2004  Matthias Clasen  <maclas@gmx.de>

	* glib/gutils.c (g_get_any_init): Don't treat the Win32
	user name like a gecos field, and when extracting a real
	name from a gecos field, replace '&' by the capitalized
	user name (a traditional passwd feature).
	(#118973, reported by Soeren Boll Overgaard)
This commit is contained in:
Matthias Clasen
2004-01-21 23:41:46 +00:00
committed by Matthias Clasen
parent e2d5240179
commit 1107a9f41a
7 changed files with 61 additions and 16 deletions

View File

@@ -1,3 +1,11 @@
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
* glib/gutils.c (g_get_any_init): Don't treat the Win32
user name like a gecos field, and when extracting a real
name from a gecos field, replace '&' by the capitalized
user name (a traditional passwd feature).
(#118973, reported by Soeren Boll Overgaard)
Tue Jan 20 22:31:22 2004 Matthias Clasen <maclas@gmx.de>
* NEWS: Start of 2.3.2 section.

View File

@@ -1,3 +1,11 @@
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
* glib/gutils.c (g_get_any_init): Don't treat the Win32
user name like a gecos field, and when extracting a real
name from a gecos field, replace '&' by the capitalized
user name (a traditional passwd feature).
(#118973, reported by Soeren Boll Overgaard)
Tue Jan 20 22:31:22 2004 Matthias Clasen <maclas@gmx.de>
* NEWS: Start of 2.3.2 section.

View File

@@ -1,3 +1,11 @@
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
* glib/gutils.c (g_get_any_init): Don't treat the Win32
user name like a gecos field, and when extracting a real
name from a gecos field, replace '&' by the capitalized
user name (a traditional passwd feature).
(#118973, reported by Soeren Boll Overgaard)
Tue Jan 20 22:31:22 2004 Matthias Clasen <maclas@gmx.de>
* NEWS: Start of 2.3.2 section.

View File

@@ -1,3 +1,11 @@
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
* glib/gutils.c (g_get_any_init): Don't treat the Win32
user name like a gecos field, and when extracting a real
name from a gecos field, replace '&' by the capitalized
user name (a traditional passwd feature).
(#118973, reported by Soeren Boll Overgaard)
Tue Jan 20 22:31:22 2004 Matthias Clasen <maclas@gmx.de>
* NEWS: Start of 2.3.2 section.

View File

@@ -1,3 +1,11 @@
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
* glib/gutils.c (g_get_any_init): Don't treat the Win32
user name like a gecos field, and when extracting a real
name from a gecos field, replace '&' by the capitalized
user name (a traditional passwd feature).
(#118973, reported by Soeren Boll Overgaard)
Tue Jan 20 22:31:22 2004 Matthias Clasen <maclas@gmx.de>
* NEWS: Start of 2.3.2 section.

View File

@@ -1,3 +1,11 @@
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
* glib/gutils.c (g_get_any_init): Don't treat the Win32
user name like a gecos field, and when extracting a real
name from a gecos field, replace '&' by the capitalized
user name (a traditional passwd feature).
(#118973, reported by Soeren Boll Overgaard)
Tue Jan 20 22:31:22 2004 Matthias Clasen <maclas@gmx.de>
* NEWS: Start of 2.3.2 section.

View File

@@ -957,8 +957,19 @@ g_get_any_init (void)
}
if (pw)
{
g_user_name = g_strdup (pw->pw_name);
g_real_name = g_strdup (pw->pw_gecos);
gchar **gecos_fields;
gchar **name_parts;
g_user_name = g_strdup (pw->pw_name);
/* split the gecos field and substitute '&' */
gecos_fields = g_strsplit (pw->pw_gecos, ",", 0);
name_parts = g_strsplit (gecos_fields[0], "&", 0);
pw->pw_name[0] = g_ascii_toupper (pw->pw_name[0]);
g_real_name = g_strjoinv (pw->pw_name, name_parts);
g_strfreev (gecos_fields);
g_strfreev (name_parts);
if (!g_home_dir)
g_home_dir = g_strdup (pw->pw_dir);
}
@@ -993,20 +1004,6 @@ g_get_any_init (void)
g_user_name = g_strdup ("somebody");
if (!g_real_name)
g_real_name = g_strdup ("Unknown");
else
{
gchar *p;
for (p = g_real_name; *p; p++)
if (*p == ',')
{
*p = 0;
p = g_strdup (g_real_name);
g_free (g_real_name);
g_real_name = p;
break;
}
}
}
}