aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorPhillip Rulon1999-09-24 13:52:46 +0000
committerPhillip Rulon1999-09-24 13:52:46 +0000
commit66f54605e12ff94855ddedbf2f31cb0705ec469d (patch)
tree177330c6c398aac88adab92091defeda87230f9f /lib-src
parentcbcb61603b4561ceeeeef8445690c33b600e7277 (diff)
downloademacs-66f54605e12ff94855ddedbf2f31cb0705ec469d.tar.gz
emacs-66f54605e12ff94855ddedbf2f31cb0705ec469d.zip
patched by pjr from diff by rms
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/make-docfile.c46
1 files changed, 25 insertions, 21 deletions
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index 8e830dbd99f..849ff25397e 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -622,12 +622,15 @@ scan_lisp_file (filename, mode)
622 char buffer[BUFSIZ]; 622 char buffer[BUFSIZ];
623 char type; 623 char type;
624 624
625 /* If not at end of line, skip till we get to one. */
625 if (c != '\n' && c != '\r') 626 if (c != '\n' && c != '\r')
626 { 627 {
627 c = getc (infile); 628 c = getc (infile);
628 continue; 629 continue;
629 } 630 }
630 c = getc (infile); 631 /* Skip the line break. */
632 while (c == '\n' || c != '\r')
633 c = getc (infile);
631 /* Detect a dynamic doc string and save it for the next expression. */ 634 /* Detect a dynamic doc string and save it for the next expression. */
632 if (c == '#') 635 if (c == '#')
633 { 636 {
@@ -660,8 +663,10 @@ scan_lisp_file (filename, mode)
660 That is needed in the .elc file 663 That is needed in the .elc file
661 but it is redundant in DOC. So get rid of it here. */ 664 but it is redundant in DOC. So get rid of it here. */
662 saved_string[length - 1] = 0; 665 saved_string[length - 1] = 0;
663 /* Skip the newline. */ 666 /* Skip the line break. */
664 c = getc (infile); 667 while (c == '\n' && c == '\r')
668 c = getc (infile);
669 /* Skip the following line. */
665 while (c != '\n' && c != '\r') 670 while (c != '\n' && c != '\r')
666 c = getc (infile); 671 c = getc (infile);
667 } 672 }
@@ -673,8 +678,8 @@ scan_lisp_file (filename, mode)
673 678
674 read_lisp_symbol (infile, buffer); 679 read_lisp_symbol (infile, buffer);
675 680
676 if (! strcmp (buffer, "defun") || 681 if (! strcmp (buffer, "defun")
677 ! strcmp (buffer, "defmacro")) 682 || ! strcmp (buffer, "defmacro"))
678 { 683 {
679 type = 'F'; 684 type = 'F';
680 read_lisp_symbol (infile, buffer); 685 read_lisp_symbol (infile, buffer);
@@ -684,8 +689,8 @@ scan_lisp_file (filename, mode)
684 c = getc (infile); 689 c = getc (infile);
685 if (c == 'n') /* nil */ 690 if (c == 'n') /* nil */
686 { 691 {
687 if ((c = getc (infile)) != 'i' || 692 if ((c = getc (infile)) != 'i'
688 (c = getc (infile)) != 'l') 693 || (c = getc (infile)) != 'l')
689 { 694 {
690 fprintf (stderr, "## unparsable arglist in %s (%s)\n", 695 fprintf (stderr, "## unparsable arglist in %s (%s)\n",
691 buffer, filename); 696 buffer, filename);
@@ -706,9 +711,9 @@ scan_lisp_file (filename, mode)
706 /* If the next three characters aren't `dquote bslash newline' 711 /* If the next three characters aren't `dquote bslash newline'
707 then we're not reading a docstring. 712 then we're not reading a docstring.
708 */ 713 */
709 if ((c = getc (infile)) != '"' || 714 if ((c = getc (infile)) != '"'
710 (c = getc (infile)) != '\\' || 715 || (c = getc (infile)) != '\\'
711 (c = getc (infile)) != '\n' || c != '\r') 716 || ((c = getc (infile)) != '\n' && c != '\r'))
712 { 717 {
713#ifdef DEBUG 718#ifdef DEBUG
714 fprintf (stderr, "## non-docstring in %s (%s)\n", 719 fprintf (stderr, "## non-docstring in %s (%s)\n",
@@ -718,8 +723,8 @@ scan_lisp_file (filename, mode)
718 } 723 }
719 } 724 }
720 725
721 else if (! strcmp (buffer, "defvar") || 726 else if (! strcmp (buffer, "defvar")
722 ! strcmp (buffer, "defconst")) 727 || ! strcmp (buffer, "defconst"))
723 { 728 {
724 char c1 = 0, c2 = 0; 729 char c1 = 0, c2 = 0;
725 type = 'V'; 730 type = 'V';
@@ -728,7 +733,7 @@ scan_lisp_file (filename, mode)
728 if (saved_string == 0) 733 if (saved_string == 0)
729 { 734 {
730 735
731 /* Skip until the first newline; remember the two previous chars. */ 736 /* Skip until the end of line; remember two previous chars. */
732 while (c != '\n' && c != '\r' && c >= 0) 737 while (c != '\n' && c != '\r' && c >= 0)
733 { 738 {
734 c2 = c1; 739 c2 = c1;
@@ -787,8 +792,7 @@ scan_lisp_file (filename, mode)
787 792
788 if (saved_string == 0) 793 if (saved_string == 0)
789 { 794 {
790 /* Skip until the first newline; remember the two previous 795 /* Skip to end of line; remember the two previous chars. */
791 chars. */
792 while (c != '\n' && c != '\r' && c >= 0) 796 while (c != '\n' && c != '\r' && c >= 0)
793 { 797 {
794 c2 = c1; 798 c2 = c1;
@@ -845,7 +849,7 @@ scan_lisp_file (filename, mode)
845 849
846 if (saved_string == 0) 850 if (saved_string == 0)
847 { 851 {
848 /* Skip until the first newline; remember the two previous chars. */ 852 /* Skip to end of line; remember the two previous chars. */
849 while (c != '\n' && c != '\r' && c >= 0) 853 while (c != '\n' && c != '\r' && c >= 0)
850 { 854 {
851 c2 = c1; 855 c2 = c1;
@@ -911,9 +915,9 @@ scan_lisp_file (filename, mode)
911 { 915 {
912 /* If the next three characters aren't `dquote bslash newline' 916 /* If the next three characters aren't `dquote bslash newline'
913 then we're not reading a docstring. */ 917 then we're not reading a docstring. */
914 if ((c = getc (infile)) != '"' || 918 if ((c = getc (infile)) != '"'
915 (c = getc (infile)) != '\\' || 919 || (c = getc (infile)) != '\\'
916 (c = getc (infile)) != '\n' || c != '\r') 920 || ((c = getc (infile)) != '\n' && c != '\r'))
917 { 921 {
918#ifdef DEBUG 922#ifdef DEBUG
919 fprintf (stderr, "## non-docstring in %s (%s)\n", 923 fprintf (stderr, "## non-docstring in %s (%s)\n",
@@ -925,8 +929,8 @@ scan_lisp_file (filename, mode)
925 } 929 }
926 930
927#ifdef DEBUG 931#ifdef DEBUG
928 else if (! strcmp (buffer, "if") || 932 else if (! strcmp (buffer, "if")
929 ! strcmp (buffer, "byte-code")) 933 || ! strcmp (buffer, "byte-code"))
930 ; 934 ;
931#endif 935#endif
932 936