aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-05-02 00:07:56 +0000
committerErik Andersen <andersen@codepoet.org>2000-05-02 00:07:56 +0000
commit5afc864422e8c572a13b3e48df47fd0e56cfbb74 (patch)
tree5a6ec9054284616133cdea4b62efdcbaddd061f9 /coreutils
parent3c1217cfad0fb72f458223ae73e1ce612f5e9efd (diff)
downloadbusybox-w32-5afc864422e8c572a13b3e48df47fd0e56cfbb74.tar.gz
busybox-w32-5afc864422e8c572a13b3e48df47fd0e56cfbb74.tar.bz2
busybox-w32-5afc864422e8c572a13b3e48df47fd0e56cfbb74.zip
More stuff
-Erik
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/tr.c6
-rw-r--r--coreutils/whoami.c11
2 files changed, 9 insertions, 8 deletions
diff --git a/coreutils/tr.c b/coreutils/tr.c
index 079c252d3..ebb64799f 100644
--- a/coreutils/tr.c
+++ b/coreutils/tr.c
@@ -2,8 +2,10 @@
2/* 2/*
3 * Mini tr implementation for busybox 3 * Mini tr implementation for busybox
4 * 4 *
5 * This version of tr is adapted from Minix tr 5 * Copyright (c) Michiel Huisjes
6 * Author: Michiel Huisjes 6 *
7 * This version of tr is adapted from Minix tr and was modified
8 * by Erik Andersen <andersee@debian.org> to be used in busybox.
7 * 9 *
8 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 11 * it under the terms of the GNU General Public License as published by
diff --git a/coreutils/whoami.c b/coreutils/whoami.c
index 5c3fea13f..f9d3f286a 100644
--- a/coreutils/whoami.c
+++ b/coreutils/whoami.c
@@ -29,16 +29,15 @@ static const char whoami_usage[] = "whoami\n\n"
29 29
30extern int whoami_main(int argc, char **argv) 30extern int whoami_main(int argc, char **argv)
31{ 31{
32 struct passwd *pw; 32 char *user = xmalloc(9);
33 uid_t uid; 33 uid_t uid = geteuid();
34 34
35 if (argc > 1) 35 if (argc > 1)
36 usage(whoami_usage); 36 usage(whoami_usage);
37 37
38 uid = geteuid(); 38 my_getpwuid(user, uid);
39 pw = getpwuid(uid); 39 if (user) {
40 if (pw) { 40 puts(user);
41 puts(pw->pw_name);
42 exit(TRUE); 41 exit(TRUE);
43 } 42 }
44 fprintf(stderr, "%s: cannot find username for UID %u\n", argv[0], 43 fprintf(stderr, "%s: cannot find username for UID %u\n", argv[0],