(scan_sexps_forward): Use the initial depth

in the starting state for tracking when we reach TARGETDEPTH.
This commit is contained in:
Richard M. Stallman 1995-08-16 15:03:24 +00:00
parent 2718dfa4b8
commit 69b07ee13a

View file

@ -1534,7 +1534,7 @@ scan_sexps_forward (stateptr, from, end, targetdepth,
error ("Nesting too deep for parser");
curlevel->prev = -1;
curlevel->last = -1;
if (!--targetdepth) goto done;
if (targetdepth != depth) goto done;
break;
case Sclose:
@ -1544,7 +1544,7 @@ scan_sexps_forward (stateptr, from, end, targetdepth,
if (curlevel != levelstart)
curlevel--;
curlevel->prev = curlevel->last;
if (!++targetdepth) goto done;
if (targetdepth != depth) goto done;
break;
case Sstring: