summary refs log tree commit diff
path: root/locale
diff options
context:
space:
mode:
Diffstat (limited to 'locale')
-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;