1998-03-17  Ulrich Drepper  <drepper@cygnus.com>

	* posix/wordexp.c (parse_param): Fix off-by-on error in $@
	handling.  Optimize a bit.
This commit is contained in:
Ulrich Drepper 1998-03-17 17:40:39 +00:00
parent 3c20b9b6a5
commit 4886901212
3 changed files with 18 additions and 7 deletions

View File

@ -1,3 +1,8 @@
1998-03-17 Ulrich Drepper <drepper@cygnus.com>
* posix/wordexp.c (parse_param): Fix off-by-on error in $@
handling. Optimize a bit.
1998-03-18 00:25 Tim Waugh <tim@cyberelk.demon.co.uk> 1998-03-18 00:25 Tim Waugh <tim@cyberelk.demon.co.uk>
* posix/wordexp.c (parse_comm): Allow quoting inside $(...). * posix/wordexp.c (parse_comm): Allow quoting inside $(...).

6
NEWS
View File

@ -32,8 +32,8 @@ Version 2.1
* scanf recognizes the %a and %A format for scanning floating point numbers. * scanf recognizes the %a and %A format for scanning floating point numbers.
* the new header <inttypes.h> from ISO C 9X provides information and * the new headers <stdint.h> and <inttypes.h> from ISO C 9X provides
interfaces for the available integer types. information and interfaces for the available integer types.
* the new header <complex.h> contains definitions of the complex math * the new header <complex.h> contains definitions of the complex math
functions from ISO C 9X. functions from ISO C 9X.
@ -59,6 +59,8 @@ Version 2.1
(nscd). (nscd).
* Tim Waugh provided an implementation of the POSIX.2 wordexp function family. * Tim Waugh provided an implementation of the POSIX.2 wordexp function family.
* Mark Kettenis provided a Hesiod NSS module.
Version 2.0.5 Version 2.0.5

View File

@ -1366,14 +1366,18 @@ envsubst:
if (*word == NULL) if (*word == NULL)
return WRDE_NOSPACE; 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)) if (w_addword (pwordexp, *word))
return WRDE_NOSPACE; return WRDE_NOSPACE;
*word = __strdup (__libc_argv[p]); len = strlen (__libc_argv[p]) + 1;
*max_length = *word_length = strlen (*word); s = malloc (len);
if (*word == NULL) if (s == NULL)
return WRDE_NOSPACE; return WRDE_NOSPACE;
*word = memcpy (s, __libc_argv[p], len);
*max_length = *word_length = len;
} }
} }