summaryrefslogtreecommitdiff
path: root/src/syntax.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-10-12 08:24:47 +0000
committerRichard M. Stallman <rms@gnu.org>1994-10-12 08:24:47 +0000
commit6776d3b0c5eaaa98876ca802a9f59aeb87cfea0b (patch)
tree850f9ba9fca5731f09d0c63eb7e9b37920f489ee /src/syntax.c
parent69a2c0d92da2e654b73bba58a4df1fee70894eba (diff)
downloademacs-6776d3b0c5eaaa98876ca802a9f59aeb87cfea0b.tar.gz
(scan_sexps_forward): At startincomment,
do notice a 2-char comment ender that straddles FROM.
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 41a236eb5bd..8d7f908865f 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1511,9 +1511,20 @@ scan_sexps_forward (stateptr, from, end, targetdepth,
curlevel->prev = curlevel->last;
break;
+ startincomment:
+ if (commentstop)
+ goto done;
+ if (from != BEGV)
+ {
+ /* Enter the loop in the middle so that we find
+ a 2-char comment ender if we start in the middle of it. */
+ prev = FETCH_CHAR (from - 1);
+ goto startincomment_1;
+ }
+ /* At beginning of buffer, enter the loop the ordinary way. */
+
case Scomment:
state.incomment = 1;
- startincomment:
if (commentstop)
goto done;
while (1)
@@ -1527,6 +1538,7 @@ scan_sexps_forward (stateptr, from, end, targetdepth,
encountered. */
break;
from++;
+ startincomment_1:
if (from < end && SYNTAX_COMEND_FIRST (prev)
&& SYNTAX_COMEND_SECOND (FETCH_CHAR (from))
&& SYNTAX_COMMENT_STYLE (prev) == state.comstyle)