]> git.eshelyaron.com Git - emacs.git/commitdiff
(skip_chars): Treat '-' at end of string as ordinary
authorAndreas Schwab <schwab@suse.de>
Tue, 6 Jan 2004 16:11:00 +0000 (16:11 +0000)
committerAndreas Schwab <schwab@suse.de>
Tue, 6 Jan 2004 16:11:00 +0000 (16:11 +0000)
character.

src/ChangeLog
src/syntax.c

index d219466e0b81aa982e978f52c493ef58c87c88ab..5447337a5701ea1f0254658cb0340a35f7dcc7d1 100644 (file)
@@ -1,3 +1,8 @@
+2004-01-06  Andreas Schwab  <schwab@suse.de>
+
+       * syntax.c (skip_chars): Treat '-' at end of string as ordinary
+       character.
+
 2004-01-02  Andreas Schwab  <schwab@suse.de>
 
        * macterm.c (emacs_options, x_initialized, same_x_server): Remove
index 79df112d26510dff79e5de73627c4a882caf2912..30fc94267cdeeb79ad77c30faa1ff918d2b717dd 100644 (file)
@@ -1,5 +1,5 @@
 /* GNU Emacs routines to deal with syntax tables; also word and list parsing.
-   Copyright (C) 1985, 87, 93, 94, 95, 97, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1985, 87, 93, 94, 95, 97, 1998, 1999, 2004 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -1442,10 +1442,13 @@ skip_chars (forwardp, syntaxp, string, lim)
              if (i_byte == size_byte)
                break;
 
-             c = STRING_CHAR_AND_LENGTH (str+i_byte, size_byte-i_byte, len);
+             c = STRING_CHAR_AND_LENGTH (str + i_byte,
+                                         size_byte - i_byte, len);
              i_byte += len;
            }
-         if (i_byte < size_byte
+         /* Treat `-' as range character only if another character
+            follows.  */
+         if (i_byte + 1 < size_byte
              && str[i_byte] == '-')
            {
              unsigned int c2;
@@ -1453,11 +1456,9 @@ skip_chars (forwardp, syntaxp, string, lim)
              /* Skip over the dash.  */
              i_byte++;
 
-             if (i_byte == size_byte)
-               break;
-
              /* Get the end of the range.  */
-             c2 =STRING_CHAR_AND_LENGTH (str+i_byte, size_byte-i_byte, len);
+             c2 = STRING_CHAR_AND_LENGTH (str + i_byte,
+                                          size_byte - i_byte, len);
              i_byte += len;
 
              if (SINGLE_BYTE_CHAR_P (c))