From 488690121208fb26e6f87cdbbf9bf540fa4a7140 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 17 Mar 1998 17:40:39 +0000 Subject: Update. 1998-03-17 Ulrich Drepper * posix/wordexp.c (parse_param): Fix off-by-on error in $@ handling. Optimize a bit. --- ChangeLog | 5 +++++ NEWS | 6 ++++-- posix/wordexp.c | 14 +++++++++----- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 87a4bafa7e..a6d6299538 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +1998-03-17 Ulrich Drepper + + * posix/wordexp.c (parse_param): Fix off-by-on error in $@ + handling. Optimize a bit. + 1998-03-18 00:25 Tim Waugh * posix/wordexp.c (parse_comm): Allow quoting inside $(...). diff --git a/NEWS b/NEWS index 9a86da0747..6e0c6b5ebe 100644 --- a/NEWS +++ b/NEWS @@ -32,8 +32,8 @@ Version 2.1 * scanf recognizes the %a and %A format for scanning floating point numbers. -* the new header from ISO C 9X provides information and - interfaces for the available integer types. +* the new headers and from ISO C 9X provides + information and interfaces for the available integer types. * the new header contains definitions of the complex math functions from ISO C 9X. @@ -59,6 +59,8 @@ Version 2.1 (nscd). * Tim Waugh provided an implementation of the POSIX.2 wordexp function family. + +* Mark Kettenis provided a Hesiod NSS module. Version 2.0.5 diff --git a/posix/wordexp.c b/posix/wordexp.c index 54f830cc2c..51cdc93df5 100644 --- a/posix/wordexp.c +++ b/posix/wordexp.c @@ -1366,17 +1366,21 @@ envsubst: if (*word == NULL) return WRDE_NOSPACE; - for (p = 1; __libc_argv[p]; p++) + for (p = 2; __libc_argv[p]; p++) { + size_t len; + char *s; if (w_addword (pwordexp, *word)) return WRDE_NOSPACE; - *word = __strdup (__libc_argv[p]); - *max_length = *word_length = strlen (*word); - if (*word == NULL) + len = strlen (__libc_argv[p]) + 1; + s = malloc (len); + if (s == NULL) return WRDE_NOSPACE; + *word = memcpy (s, __libc_argv[p], len); + *max_length = *word_length = len; } } - + return 0; } -- cgit v1.2.1