about summary refs log tree commit diff
path: root/locale/programs/linereader.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-03-14 09:27:24 +0000
committerUlrich Drepper <drepper@redhat.com>1998-03-14 09:27:24 +0000
commit76fbcfdd66556dfe8e813cda50ac28071d0da573 (patch)
tree24f1c4235a09ebbc502bd0d281b1475580c085aa /locale/programs/linereader.c
parent14c44e2ec42a3c973e268add83a11e3e5fb0b80c (diff)
downloadglibc-76fbcfdd66556dfe8e813cda50ac28071d0da573.tar.gz
glibc-76fbcfdd66556dfe8e813cda50ac28071d0da573.tar.xz
glibc-76fbcfdd66556dfe8e813cda50ac28071d0da573.zip
Update.
1998-03-14 00:52  Tim Waugh  <tim@cyberelk.demon.co.uk>

	* posix/wordexp.c (parse_param): Perform field-splitting after
	expanding positional parameter.

	* posix/wordexp-tst.sh: Test that field-splitting is performed
	after expanding positional parameter.

	* posix/wordexp.c (parse_param): Fixed memory leak in
	field-splitting after parameter expansion.

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

	* locale/programs/linereader.c (lr_token): Return EOF token at
	EOF.
	(get_toplvl_escape): Correctly terminate loop at EOF.
	Patch by Cristian Gafton <gafton@redhat.com>.
Diffstat (limited to 'locale/programs/linereader.c')
-rw-r--r--locale/programs/linereader.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/locale/programs/linereader.c b/locale/programs/linereader.c
index 83679b7655..8da5c5330f 100644
--- a/locale/programs/linereader.c
+++ b/locale/programs/linereader.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
 
@@ -159,6 +159,12 @@ lr_token (struct linereader *lr, const struct charset_t *charset)
 	{
 	  ch = lr_getc (lr);
 
+	  if (ch == EOF)
+	    {
+	      lr->token.tok = tok_eof;
+	      return &lr->token;
+	    };
+
 	  if (ch == '\n')
 	    {
 	      lr->token.tok = tok_eol;
@@ -283,7 +289,7 @@ get_toplvl_escape (struct linereader *lr)
 	esc_error:
 	  lr->token.val.str.start = &lr->buf[start_idx];
 
-	  while (ch != EOF || !isspace (ch))
+	  while (ch != EOF && !isspace (ch))
 	    ch = lr_getc (lr);
 	  lr->token.val.str.len = lr->idx - start_idx;