From 700e08993c3f6a808773d56424aa7e633da13e2e Mon Sep 17 00:00:00 2001 From: Josiah Worcester Date: Tue, 10 Feb 2015 18:32:55 -0600 Subject: refactor passwd file access code this allows getpwnam and getpwuid to share code with the _r versions in preparation for alternate backend support. --- src/passwd/fgetpwent.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/passwd/fgetpwent.c') diff --git a/src/passwd/fgetpwent.c b/src/passwd/fgetpwent.c index eb47b2a1..fd472a07 100644 --- a/src/passwd/fgetpwent.c +++ b/src/passwd/fgetpwent.c @@ -6,5 +6,7 @@ struct passwd *fgetpwent(FILE *f) static char *line; static struct passwd pw; size_t size=0; - return __getpwent_a(f, &pw, &line, &size); + struct passwd *res; + __getpwent_a(f, &pw, &line, &size, &res); + return res; } -- cgit v1.2.1