summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2012-06-08 23:33:58 +0200
committerAndreas Schwab <schwab@linux-m68k.org>2012-06-08 23:33:58 +0200
commit7cb70fd73eccd2725b8e436bff3295506816f935 (patch)
treed30176a9a4792b32e35dfb98a5c656fe73ca9e05
parentf81298f8af5eda541027adddb0730cafdaa9ea57 (diff)
downloademacs-7cb70fd73eccd2725b8e436bff3295506816f935.tar.gz
* make-docfile.c (search_lisp_doc_at_eol): Unget last read
character.
-rw-r--r--lib-src/ChangeLog5
-rw-r--r--lib-src/make-docfile.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index b6f5c3ead60..68a8c37c2fb 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,8 @@
+2012-06-08 Andreas Schwab <schwab@linux-m68k.org>
+
+ * make-docfile.c (search_lisp_doc_at_eol): Unget last read
+ character.
+
2012-06-06 Glenn Morris <rgm@gnu.org>
* Makefile.in (STAMP_INST_SCRIPTS, STAMP_SCRIPTS, insrcdir)
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index 1314a7b6829..4f68fdb78c9 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -1025,7 +1025,7 @@ search_lisp_doc_at_eol (FILE *infile)
char c = 0, c1 = 0, c2 = 0;
/* Skip until the end of line; remember two previous chars. */
- while (c != '\n' && c != '\r' && c >= 0)
+ while (c != '\n' && c != '\r' && c != EOF)
{
c2 = c1;
c1 = c;
@@ -1040,6 +1040,8 @@ search_lisp_doc_at_eol (FILE *infile)
fprintf (stderr, "## non-docstring in %s (%s)\n",
buffer, filename);
#endif
+ if (c != EOF)
+ ungetc (c, infile);
return 0;
}
return 1;