From 5afc864422e8c572a13b3e48df47fd0e56cfbb74 Mon Sep 17 00:00:00 2001 From: Erik Andersen Date: Tue, 2 May 2000 00:07:56 +0000 Subject: More stuff -Erik --- coreutils/tr.c | 6 ++++-- coreutils/whoami.c | 11 +++++------ 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'coreutils') 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 @@ /* * Mini tr implementation for busybox * - * This version of tr is adapted from Minix tr - * Author: Michiel Huisjes + * Copyright (c) Michiel Huisjes + * + * This version of tr is adapted from Minix tr and was modified + * by Erik Andersen to be used in busybox. * * This program is free software; you can redistribute it and/or modify * 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" extern int whoami_main(int argc, char **argv) { - struct passwd *pw; - uid_t uid; + char *user = xmalloc(9); + uid_t uid = geteuid(); if (argc > 1) usage(whoami_usage); - uid = geteuid(); - pw = getpwuid(uid); - if (pw) { - puts(pw->pw_name); + my_getpwuid(user, uid); + if (user) { + puts(user); exit(TRUE); } fprintf(stderr, "%s: cannot find username for UID %u\n", argv[0], -- cgit v1.2.3