aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorRichard M. Stallman1999-09-03 23:12:27 +0000
committerRichard M. Stallman1999-09-03 23:12:27 +0000
commit433d333d70779dbe1928bd4c29aa49f9c114c199 (patch)
tree10d5ba484178bbbbca1f1115587c8af06c92a620 /lib-src
parent61355f1c8660b97f27a3b4cc942f531643abbb24 (diff)
downloademacs-433d333d70779dbe1928bd4c29aa49f9c114c199.tar.gz
emacs-433d333d70779dbe1928bd4c29aa49f9c114c199.zip
Include config.h not ../src/config.h.
(main, fopen, chdir): Add #undef. (read_c_string, scan_c_file, skip_white, read_lisp_symbol) (scan_lisp_file): Handle \r like \n.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/make-docfile.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index cfa0685e944..55920ce6dc4 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -33,7 +33,12 @@ Boston, MA 02111-1307, USA. */
33 */ 33 */
34 34
35#define NO_SHORTNAMES /* Tell config not to load remap.h */ 35#define NO_SHORTNAMES /* Tell config not to load remap.h */
36#include <../src/config.h> 36#include <config.h>
37
38/* defined to be emacs_main, sys_fopen, etc. in config.h */
39#undef main
40#undef fopen
41#undef chdir
37 42
38#include <stdio.h> 43#include <stdio.h>
39#ifdef MSDOS 44#ifdef MSDOS
@@ -219,7 +224,7 @@ read_c_string (infile, printflag)
219 if (c == '\\') 224 if (c == '\\')
220 { 225 {
221 c = getc (infile); 226 c = getc (infile);
222 if (c == '\n') 227 if (c == '\n' || c == '\r')
223 { 228 {
224 c = getc (infile); 229 c = getc (infile);
225 continue; 230 continue;
@@ -367,7 +372,7 @@ scan_c_file (filename, mode)
367 c = '\n'; 372 c = '\n';
368 while (!feof (infile)) 373 while (!feof (infile))
369 { 374 {
370 if (c != '\n') 375 if (c != '\n' && c != '\r')
371 { 376 {
372 c = getc (infile); 377 c = getc (infile);
373 continue; 378 continue;
@@ -450,7 +455,7 @@ scan_c_file (filename, mode)
450 { 455 {
451 do 456 do
452 c = getc (infile); 457 c = getc (infile);
453 while (c == ' ' || c == '\n' || c == '\t'); 458 while (c == ' ' || c == '\n' || c == '\r' || c == '\t');
454 if (c < 0) 459 if (c < 0)
455 goto eof; 460 goto eof;
456 ungetc (c, infile); 461 ungetc (c, infile);
@@ -467,14 +472,14 @@ scan_c_file (filename, mode)
467 goto eof; 472 goto eof;
468 c = getc (infile); 473 c = getc (infile);
469 } 474 }
470 while (c == ' ' || c == '\n' || c == '\t') 475 while (c == ' ' || c == '\n' || c == '\r' || c == '\t')
471 c = getc (infile); 476 c = getc (infile);
472 if (c == '"') 477 if (c == '"')
473 c = read_c_string (infile, 0); 478 c = read_c_string (infile, 0);
474 while (c != ',') 479 while (c != ',')
475 c = getc (infile); 480 c = getc (infile);
476 c = getc (infile); 481 c = getc (infile);
477 while (c == ' ' || c == '\n' || c == '\t') 482 while (c == ' ' || c == '\n' || c == '\r' || c == '\t')
478 c = getc (infile); 483 c = getc (infile);
479 484
480 if (c == '"') 485 if (c == '"')
@@ -558,7 +563,7 @@ skip_white (infile)
558 FILE *infile; 563 FILE *infile;
559{ 564{
560 char c = ' '; 565 char c = ' ';
561 while (c == ' ' || c == '\t' || c == '\n') 566 while (c == ' ' || c == '\t' || c == '\n' || c == '\r')
562 c = getc (infile); 567 c = getc (infile);
563 ungetc (c, infile); 568 ungetc (c, infile);
564} 569}
@@ -577,7 +582,7 @@ read_lisp_symbol (infile, buffer)
577 c = getc (infile); 582 c = getc (infile);
578 if (c == '\\') 583 if (c == '\\')
579 *(++fillp) = getc (infile); 584 *(++fillp) = getc (infile);
580 else if (c == ' ' || c == '\t' || c == '\n' || c == '(' || c == ')') 585 else if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '(' || c == ')')
581 { 586 {
582 ungetc (c, infile); 587 ungetc (c, infile);
583 *fillp = 0; 588 *fillp = 0;
@@ -614,7 +619,7 @@ scan_lisp_file (filename, mode)
614 char buffer[BUFSIZ]; 619 char buffer[BUFSIZ];
615 char type; 620 char type;
616 621
617 if (c != '\n') 622 if (c != '\n' && c != '\r')
618 { 623 {
619 c = getc (infile); 624 c = getc (infile);
620 continue; 625 continue;
@@ -654,7 +659,7 @@ scan_lisp_file (filename, mode)
654 saved_string[length - 1] = 0; 659 saved_string[length - 1] = 0;
655 /* Skip the newline. */ 660 /* Skip the newline. */
656 c = getc (infile); 661 c = getc (infile);
657 while (c != '\n') 662 while (c != '\n' && c != '\r')
658 c = getc (infile); 663 c = getc (infile);
659 } 664 }
660 continue; 665 continue;
@@ -700,7 +705,7 @@ scan_lisp_file (filename, mode)
700 */ 705 */
701 if ((c = getc (infile)) != '"' || 706 if ((c = getc (infile)) != '"' ||
702 (c = getc (infile)) != '\\' || 707 (c = getc (infile)) != '\\' ||
703 (c = getc (infile)) != '\n') 708 (c = getc (infile)) != '\n' || c != '\r')
704 { 709 {
705#ifdef DEBUG 710#ifdef DEBUG
706 fprintf (stderr, "## non-docstring in %s (%s)\n", 711 fprintf (stderr, "## non-docstring in %s (%s)\n",
@@ -721,7 +726,7 @@ scan_lisp_file (filename, mode)
721 { 726 {
722 727
723 /* Skip until the first newline; remember the two previous chars. */ 728 /* Skip until the first newline; remember the two previous chars. */
724 while (c != '\n' && c >= 0) 729 while (c != '\n' && c != '\r' && c >= 0)
725 { 730 {
726 c2 = c1; 731 c2 = c1;
727 c1 = c; 732 c1 = c;
@@ -781,7 +786,7 @@ scan_lisp_file (filename, mode)
781 { 786 {
782 /* Skip until the first newline; remember the two previous 787 /* Skip until the first newline; remember the two previous
783 chars. */ 788 chars. */
784 while (c != '\n' && c >= 0) 789 while (c != '\n' && c != '\r' && c >= 0)
785 { 790 {
786 c2 = c1; 791 c2 = c1;
787 c1 = c; 792 c1 = c;
@@ -838,7 +843,7 @@ scan_lisp_file (filename, mode)
838 if (saved_string == 0) 843 if (saved_string == 0)
839 { 844 {
840 /* Skip until the first newline; remember the two previous chars. */ 845 /* Skip until the first newline; remember the two previous chars. */
841 while (c != '\n' && c >= 0) 846 while (c != '\n' && c != '\r' && c >= 0)
842 { 847 {
843 c2 = c1; 848 c2 = c1;
844 c1 = c; 849 c1 = c;
@@ -905,7 +910,7 @@ scan_lisp_file (filename, mode)
905 then we're not reading a docstring. */ 910 then we're not reading a docstring. */
906 if ((c = getc (infile)) != '"' || 911 if ((c = getc (infile)) != '"' ||
907 (c = getc (infile)) != '\\' || 912 (c = getc (infile)) != '\\' ||
908 (c = getc (infile)) != '\n') 913 (c = getc (infile)) != '\n' || c != '\r')
909 { 914 {
910#ifdef DEBUG 915#ifdef DEBUG
911 fprintf (stderr, "## non-docstring in %s (%s)\n", 916 fprintf (stderr, "## non-docstring in %s (%s)\n",