summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/c99-to-c89.diff19
-rw-r--r--src/groups.c2
-rw-r--r--src/id.c11
3 files changed, 4 insertions, 28 deletions
diff --git a/src/c99-to-c89.diff b/src/c99-to-c89.diff
index 81580197c..b0594fd36 100644
--- a/src/c99-to-c89.diff
+++ b/src/c99-to-c89.diff
@@ -1,22 +1,3 @@
---- src/id.c 2008-03-04 18:50:55.000000000 +0100
-+++ src/id.c 2008-03-04 19:32:24.000000000 +0100
-@@ -196,6 +196,7 @@ of a different user"));
- error (EXIT_FAILURE, 0,
- _("cannot print only names or real IDs in default format"));
-
-+ {
- char const *user_name;
- if (argc - optind == 1)
- {
-@@ -239,6 +240,7 @@ of a different user"));
- {
- print_full_info (user_name);
- }
-+ }
- putchar ('\n');
-
- exit (ok ? EXIT_SUCCESS : EXIT_FAILURE);
-diff -upr src/remove.c src/remove.c
--- src/remove.c 2007-07-23 12:56:20.000000000 +0200
+++ src/remove.c 2007-07-23 13:03:12.000000000 +0200
@@ -264,9 +264,10 @@ pop_dir (Dirstack_state *ds)
diff --git a/src/groups.c b/src/groups.c
index c8e617b58..baac7b931 100644
--- a/src/groups.c
+++ b/src/groups.c
@@ -102,7 +102,7 @@ main (int argc, char **argv)
egid = getegid ();
rgid = getgid ();
- if (!print_group_list (getlogin (), ruid, rgid, egid, true))
+ if (!print_group_list (NULL, ruid, rgid, egid, true))
ok = false;
putchar ('\n');
}
diff --git a/src/id.c b/src/id.c
index a178714fd..e4eda4071 100644
--- a/src/id.c
+++ b/src/id.c
@@ -196,22 +196,17 @@ of a different user"));
error (EXIT_FAILURE, 0,
_("cannot print only names or real IDs in default format"));
- char const *user_name;
if (argc - optind == 1)
{
- struct passwd const *pwd = getpwnam (argv[optind]);
+ struct passwd *pwd = getpwnam (argv[optind]);
if (pwd == NULL)
error (EXIT_FAILURE, 0, _("%s: No such user"), argv[optind]);
- user_name = argv[optind];
ruid = euid = pwd->pw_uid;
rgid = egid = pwd->pw_gid;
}
else
{
- struct passwd const *pwd;
euid = geteuid ();
- pwd = getpwuid (euid);
- user_name = pwd ? xstrdup (pwd->pw_name) : NULL;
ruid = getuid ();
egid = getegid ();
rgid = getgid ();
@@ -228,7 +223,7 @@ of a different user"));
}
else if (just_group_list)
{
- if (!print_group_list (user_name, ruid, rgid, egid, use_name))
+ if (!print_group_list (argv[optind], ruid, rgid, egid, use_name))
ok = false;
}
else if (just_context)
@@ -237,7 +232,7 @@ of a different user"));
}
else
{
- print_full_info (user_name);
+ print_full_info (argv[optind]);
}
putchar ('\n');