2001-02-09  Ulrich Drepper  <drepper@redhat.com>

	* locale/programs/linereader.c (get_ident): Stop loop if EOF.  Use
	lr_ungetc to push back last read character.
	* locale/programs/linereader.h (lr_ungetc): Don't push back is
	character is EOF.
	(lr_ignore_rest): Don't warn about garbage if it is really the end
	of the file.

	* manual/Makefile: Use ifnottext and not ifinfo to protect Top node
	definition.
This commit is contained in:
Ulrich Drepper 2001-02-09 17:02:23 +00:00
parent 90feeaa2eb
commit f126ef6731
6 changed files with 29 additions and 13 deletions

View File

@ -1,3 +1,15 @@
2001-02-09 Ulrich Drepper <drepper@redhat.com>
* locale/programs/linereader.c (get_ident): Stop loop if EOF. Use
lr_ungetc to push back last read character.
* locale/programs/linereader.h (lr_ungetc): Don't push back is
character is EOF.
(lr_ignore_rest): Don't warn about garbage if it is really the end
of the file.
* manual/Makefile: Use ifnottext and not ifinfo to protect Top node
definition.
2001-02-08 Ulrich Drepper <drepper@redhat.com> 2001-02-08 Ulrich Drepper <drepper@redhat.com>
* Makerules (build-shlib): Work around different order of * Makerules (build-shlib): Work around different order of

View File

@ -528,7 +528,7 @@ get_ident (struct linereader *lr)
ADDC (lr->buf[lr->idx - 1]); ADDC (lr->buf[lr->idx - 1]);
while (!isspace ((ch = lr_getc (lr))) && ch != '"' && ch != ';' while (!isspace ((ch = lr_getc (lr))) && ch != '"' && ch != ';'
&& ch != '<' && ch != ',') && ch != '<' && ch != ',' && ch != EOF)
{ {
if (ch == lr->escape_char) if (ch == lr->escape_char)
{ {
@ -542,7 +542,7 @@ get_ident (struct linereader *lr)
ADDC (ch); ADDC (ch);
} }
lr_ungetn (lr, 1); lr_ungetc (lr, ch);
kw = lr->hash_fct (buf, bufact); kw = lr->hash_fct (buf, bufact);

View File

@ -123,7 +123,8 @@ lr_ungetc (struct linereader *lr, int ch)
if (lr->idx == 0) if (lr->idx == 0)
return -1; return -1;
lr->buf[--lr->idx] = ch; if (ch != EOF)
lr->buf[--lr->idx] = ch;
return 0; return 0;
} }
@ -154,7 +155,8 @@ lr_ignore_rest (struct linereader *lr, int verbose)
else else
++lr->idx; ++lr->idx;
if (lr->buf[lr->idx] != '\n' &&lr->buf[lr->idx] != lr->comment_char) 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")); lr_error (lr, _("trailing garbage at end of line"));
} }

View File

@ -101,13 +101,13 @@ Foundation.
@end titlepage @end titlepage
@page @page
@ifinfo @ifnottex
@node Top, Introduction, (dir), (dir) @node Top, Introduction, (dir), (dir)
@top Main Menu @top Main Menu
This is Edition @value{EDITION}, last updated @value{UPDATED}, of This is Edition @value{EDITION}, last updated @value{UPDATED}, of
@cite{The GNU C Library Reference Manual}, for Version @value{VERSION} @cite{The GNU C Library Reference Manual}, for Version @value{VERSION}
of the GNU C Library. of the GNU C Library.
@end ifinfo @end ifnottex
@include top-menu.texi @include top-menu.texi
@include chapters.texi @include chapters.texi

View File

@ -4222,10 +4222,10 @@ This function is declared in the @file{stdio_ext.h} header.
@comment stdio_ext.h @comment stdio_ext.h
@comment GNU @comment GNU
@deftypefun size_t __fpending (FILE *@var{stream}) @deftypefun size_t __fpending (FILE *@var{stream}) The @code{__fpending}
The @code{__fpending} function returns the number of bytes currently in function returns the number of bytes currently in the output buffer.
the output buffer. This function should not be used on buffers in read For wide-oriented stream the measuring unit is wide characters. This
mode or opened read-only. function should not be used on buffers in read mode or opened read-only.
This function is declared in the @file{stdio_ext.h} header. This function is declared in the @file{stdio_ext.h} header.
@end deftypefun @end deftypefun

View File

@ -341,6 +341,7 @@ gets stored.
@end menu @end menu
@node Mount Information, Mount-Unmount-Remount, , Filesystem Handling @node Mount Information, Mount-Unmount-Remount, , Filesystem Handling
@subsection Mount Information
For some programs it is desirable and necessary to access information For some programs it is desirable and necessary to access information
about whether a certain filesystem is mounted and, if it is, where, or about whether a certain filesystem is mounted and, if it is, where, or
@ -384,7 +385,7 @@ names should always be used.
@end menu @end menu
@node fstab @node fstab
@subsection The @file{fstab} file @subsubsection The @file{fstab} file
The internal representation for entries of the file is @w{@code{struct The internal representation for entries of the file is @w{@code{struct
fstab}}, defined in @file{fstab.h}. fstab}}, defined in @file{fstab.h}.
@ -536,7 +537,7 @@ returns a @code{NULL} pointer.
@node mtab @node mtab
@subsection The @file{mtab} file @subsubsection The @file{mtab} file
The following functions and data structure access the @file{mtab} file. The following functions and data structure access the @file{mtab} file.
@comment mntent.h @comment mntent.h
@ -746,7 +747,7 @@ when all options have to be processed one is better off with using the
@end deftypefun @end deftypefun
@node Other Mount Information @node Other Mount Information
@subsection Other (Non-libc) Sources of Mount Information @subsubsection Other (Non-libc) Sources of Mount Information
On a system with a Linux kernel and the @code{proc} filesystem, you can On a system with a Linux kernel and the @code{proc} filesystem, you can
get information on currently mounted filesystems from the file get information on currently mounted filesystems from the file
@ -757,6 +758,7 @@ to date.
@node Mount-Unmount-Remount, , Mount Information, Filesystem Handling @node Mount-Unmount-Remount, , Mount Information, Filesystem Handling
@subsection Mount, Unmount, Remount
This section describes the functions for mounting, unmounting, and This section describes the functions for mounting, unmounting, and
remounting filesystems. remounting filesystems.