From dbe31b9a738993b563382c602d092c970bdc79ae Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 5 Jul 1996 19:18:13 +0000 Subject: * nss/nss_files/files-parse.c (parse_list): Set EOL from LINE if it points within DATA->linebuffer; otherwise use all of DATA->linebuffer itself, no need to skip past a NUL. * nss/nsswitch.h (known_function): Comment fix. * nss/nsswitch.c (nss_lookup_function): Rewritten using __tsearch directly. Do the lookup and insertion with a single call, and fill in the tree node afterwards if new. (known_compare, nss_find_entry, nss_insert_entry): Functions removed. * misc/sys/select.h: #define __need_timespec before incl. (struct timeval): Add bodiless decl for scope. * time/time.h (struct timespec): Rename members from `ts_*' to `tv_*'. Move struct timespec defn outside [_TIME_H] so it can be got with #define __need_timespec. * time/sys/time.h (TIMEVAL_TO_TIMESPEC): Use `tv_*' instead of `ts_*' for `struct timespec' member names. (TIMESPEC_TO_TIMEVAL): Likewise. * nss/Makefile (extra-libs-others): New variable. * extra-lib.mk: Don't test for $($(lib)-no-lib-dep). Instead match $(lib) in $(extra-libs-others). * sunrpc/Makefile (extra-libs-others): New variable. (librpcsvc-no-lib-dep): Variable removed. Thu Jul 4 05:21:59 1996 David Mosberger-Tang * login/utmp.h: Fix typos. * misc/syslog.c (vsyslog): Use __send instead of send and __connect instead of connect to avoid name-space collisions (e.g., with psgetty). --- nss/nss_files/files-parse.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'nss/nss_files') diff --git a/nss/nss_files/files-parse.c b/nss/nss_files/files-parse.c index 8930780f1f..1f3b13886d 100644 --- a/nss/nss_files/files-parse.c +++ b/nss/nss_files/files-parse.c @@ -128,8 +128,15 @@ parse_list (char *line, struct parser_data *data, int datalen) { char *eol, **list, **p; - /* Find the end of the line buffer. */ - eol = strchr (data->linebuffer, '\0') + 1; + if (line >= data->linebuffer && line < (char *) data + datalen) + /* Find the end of the line buffer, we will use the space in DATA after + it for storing the vector of pointers. */ + eol = strchr (line, '\0') + 1; + else + /* LINE does not point within DATA->linebuffer, so that space is + not being used for scratch space right now. We can use all of + it for the pointer vector storage. */ + eol = data->linebuffer; /* Adjust the pointer so it is aligned for storing pointers. */ eol += __alignof__ (char *) - 1; eol -= (eol - (char *) 0) % __alignof__ (char *); -- cgit 1.4.1