about summary refs log tree commit diff
path: root/locale/programs/linereader.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-06-11 21:57:23 +0000
committerUlrich Drepper <drepper@redhat.com>2003-06-11 21:57:23 +0000
commitdd9423a67a7650a9b0f50d8151e4f3797c5a14f8 (patch)
tree2b796d5a03925d5782c12a7844c54f631f7d789c /locale/programs/linereader.c
parentc98d505c4dd96f7a58a3434fadbe4f6c30c29b08 (diff)
downloadglibc-dd9423a67a7650a9b0f50d8151e4f3797c5a14f8.tar.gz
glibc-dd9423a67a7650a9b0f50d8151e4f3797c5a14f8.tar.xz
glibc-dd9423a67a7650a9b0f50d8151e4f3797c5a14f8.zip
Update.
2003-06-11  Ulrich Drepper  <drepper@redhat.com>

	* allocatestack.c (queue_stack): Always inline.
	* ptreadhP.h (__do_cancel): Likewise.
Diffstat (limited to 'locale/programs/linereader.c')
-rw-r--r--locale/programs/linereader.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/locale/programs/linereader.c b/locale/programs/linereader.c
index 1df7df7e50..c3865e4dd5 100644
--- a/locale/programs/linereader.c
+++ b/locale/programs/linereader.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2001, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
 
@@ -111,6 +111,35 @@ lr_eof (struct linereader *lr)
 
 
 void
+lr_ignore_rest (struct linereader *lr, int verbose)
+{
+  if (verbose)
+    {
+      while (isspace (lr->buf[lr->idx]) && lr->buf[lr->idx] != '\n'
+	     && lr->buf[lr->idx] != lr->comment_char)
+	if (lr->buf[lr->idx] == '\0')
+	  {
+	    if (lr_next (lr) < 0)
+	      return;
+	  }
+	else
+	  ++lr->idx;
+
+      if (lr->buf[lr->idx] != '\n' && ! feof (lr->fp)
+	  && lr->buf[lr->idx] != lr->comment_char)
+	lr_error (lr, _("trailing garbage at end of line"));
+    }
+
+  /* Ignore continued line.  */
+  while (lr->bufact > 0 && lr->buf[lr->bufact - 1] != '\n')
+    if (lr_next (lr) < 0)
+      break;
+
+  lr->idx = lr->bufact;
+}
+
+
+void
 lr_close (struct linereader *lr)
 {
   fclose (lr->fp);