[BACK]Return to regexp.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / less

Diff for /src/usr.bin/less/Attic/regexp.c between version 1.1.1.1 and 1.1.1.2

version 1.1.1.1, 1996/09/21 05:39:44 version 1.1.1.2, 2003/04/13 18:21:21
Line 24 
Line 24 
  *   *
  * *** NOTE: this code has been altered slightly for use in Tcl. ***   * *** NOTE: this code has been altered slightly for use in Tcl. ***
  * Slightly modified by David MacKenzie to undo most of the changes for TCL.   * Slightly modified by David MacKenzie to undo most of the changes for TCL.
    * Added regexec2 with notbol parameter. -- 4/19/99 Mark Nudelman
  */   */
   
   #include "less.h"
   #if HAVE_STDIO_H
 #include <stdio.h>  #include <stdio.h>
   #endif
   #if HAVE_STDLIB_H
   #include <stdlib.h>
   #endif
   #if HAVE_STRING_H
   #include <string.h>
   #endif
 #include "regexp.h"  #include "regexp.h"
 char *strchr();  
   
 /*  /*
  * The "internal use only" fields in regexp.h are present to pass info from   * The "internal use only" fields in regexp.h are present to pass info from
Line 67 
Line 76 
  */   */
   
 /* definition   number  opnd?   meaning */  /* definition   number  opnd?   meaning */
   #undef EOL
 #define END     0       /* no   End of program. */  #define END     0       /* no   End of program. */
 #define BOL     1       /* no   Match "" at beginning of line. */  #define BOL     1       /* no   Match "" at beginning of line. */
 #define EOL     2       /* no   Match "" at end of line. */  #define EOL     2       /* no   Match "" at end of line. */
Line 710 
Line 720 
  - regexec - match a regexp against a string   - regexec - match a regexp against a string
  */   */
 int  int
 regexec(prog, string)  regexec2(prog, string, notbol)
 register regexp *prog;  register regexp *prog;
 register char *string;  register char *string;
   int notbol;
 {  {
         register char *s;          register char *s;
   
Line 741 
Line 752 
         }          }
   
         /* Mark beginning of line for ^ . */          /* Mark beginning of line for ^ . */
         regbol = string;          if (notbol)
                   regbol = NULL;
           else
                   regbol = string;
   
         /* Simplest case:  anchored match need be tried only once. */          /* Simplest case:  anchored match need be tried only once. */
         if (prog->reganch)          if (prog->reganch)
Line 765 
Line 779 
   
         /* Failure. */          /* Failure. */
         return(0);          return(0);
   }
   
   int
   regexec(prog, string)
   register regexp *prog;
   register char *string;
   {
           return regexec2(prog, string, 0);
 }  }
   
 /*  /*

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.2