comparison src/regex.c @ 1669:401c99f91a6c

*** empty log message ***
author Jim Blandy <jimb@redhat.com>
date Sat, 12 Dec 1992 14:44:09 +0000
parents 46a583ec47a9
children 5da6b5575f48
comparison
equal deleted inserted replaced
1668:46a583ec47a9 1669:401c99f91a6c
27 #define _GNU_SOURCE 27 #define _GNU_SOURCE
28 28
29 /* We need this for `regex.h', and perhaps for the Emacs include files. */ 29 /* We need this for `regex.h', and perhaps for the Emacs include files. */
30 #include <sys/types.h> 30 #include <sys/types.h>
31 31
32 #if defined (HAVE_CONFIG_H) || defined (emacs) 32 #ifdef HAVE_CONFIG_H
33 #include "config.h" 33 #include "config.h"
34 #endif 34 #endif
35 35
36 /* The `emacs' switch turns on certain matching commands 36 /* The `emacs' switch turns on certain matching commands
37 that make sense only in Emacs. */ 37 that make sense only in Emacs. */
3987 || (re_opcode_t) *p2 == start_memory)) 3987 || (re_opcode_t) *p2 == start_memory))
3988 p2 += 3; /* Skip over args, too. */ 3988 p2 += 3; /* Skip over args, too. */
3989 3989
3990 /* If we're at the end of the pattern, we can change. */ 3990 /* If we're at the end of the pattern, we can change. */
3991 if (p2 == pend) 3991 if (p2 == pend)
3992 { /* But if we're also at the end of the string, we might 3992 {
3993 as well skip changing anything. For example, in `a+' 3993 /* Consider what happens when matching ":\(.*\)"
3994 against `a', we'll have already matched the `a', and 3994 against ":/". I don't really understand this code
3995 I don't see the the point of changing the opcode, 3995 yet. */
3996 popping the failure point, finding out it fails, and
3997 then going into our endgame. */
3998 if (d == dend)
3999 {
4000 p = pend;
4001 DEBUG_PRINT1 (" End of pattern & string => done.\n");
4002 continue;
4003 }
4004
4005 p[-3] = (unsigned char) pop_failure_jump; 3996 p[-3] = (unsigned char) pop_failure_jump;
4006 DEBUG_PRINT1 (" End of pattern => pop_failure_jump.\n"); 3997 DEBUG_PRINT1
3998 (" End of pattern: change to `pop_failure_jump'.\n");
4007 } 3999 }
4008 4000
4009 else if ((re_opcode_t) *p2 == exactn 4001 else if ((re_opcode_t) *p2 == exactn
4010 || (bufp->newline_anchor && (re_opcode_t) *p2 == endline)) 4002 || (bufp->newline_anchor && (re_opcode_t) *p2 == endline))
4011 { 4003 {