Commits

Anonymous committed 3fefbc2

Correct size of syntax_spec_code

  • Participants
  • Parent commits d66da30

Comments (0)

Files changed (4)

+2011-08-05  Stephen J. Turnbull  <stephen@xemacs.org>
+	There are only (octal) 0200 ASCII characters, and only 128 values
+	supplied in the definition.
+
+	* syntax.h (syntax_spec_code):
+	* syntax.c (syntax_spec_code):
+	Declare array with correct dimension.
+	* search.c (skip_chars):
+	Correct bounds check on index of syntax_spec_code.
+
 2011-12-11  Julian Bradfield <jcb+xeb@jcbradfield.org>
 
 	* regex.c: ^ was wrongly interpreted as literal when occurring at
       INC_CHARPTR (p);
       if (syntaxp)
 	{
-	  if (c < 0400 && syntax_spec_code[c] < (unsigned char) Smax)
+	  if (c < 0200 && syntax_spec_code[c] < (unsigned char) Smax)
 	    fastmap[c] = 1;
 	  else
 	    signal_simple_error ("Invalid syntax designator",
    into the code it signifies.
    This is used by modify-syntax-entry, and other things. */
 
-const unsigned char syntax_spec_code[0400] =
+const unsigned char syntax_spec_code[0200] =
 { 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377,
   0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377,
   0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377,
    that character signifies (as a char).
    For example, (enum syntaxcode) syntax_spec_code['w'] is Sword. */
 
-extern const unsigned char syntax_spec_code[0400];
+extern const unsigned char syntax_spec_code[0200];
 
 /* Indexed by syntax code, give the letter that describes it. */