Diff for /rpl/rplawk/b.c between versions 1.1 and 1.2

version 1.1, 2010/09/07 12:53:05 version 1.2, 2013/06/12 09:47:52
Line 231  void freetr(Node *p) /* free parse tree Line 231  void freetr(Node *p) /* free parse tree
 /* in the parsing of regular expressions, metacharacters like . have */  /* in the parsing of regular expressions, metacharacters like . have */
 /* to be seen literally;  \056 is not a metacharacter. */  /* to be seen literally;  \056 is not a metacharacter. */
   
 int hexstr(char **pp)   /* find and eval hex string at pp, return new p */  int hexstr(uschar **pp) /* find and eval hex string at pp, return new p */
 {           /* only pick up one 8-bit byte (2 chars) */  {           /* only pick up one 8-bit byte (2 chars) */
     uschar *p;      uschar *p;
     int n = 0;      int n = 0;
Line 245  int hexstr(char **pp) /* find and eval h Line 245  int hexstr(char **pp) /* find and eval h
         else if (*p >= 'A' && *p <= 'F')          else if (*p >= 'A' && *p <= 'F')
             n = 16 * n + *p - 'A' + 10;              n = 16 * n + *p - 'A' + 10;
     }      }
     *pp = (char *) p;      *pp = (uschar *) p;
     return n;      return n;
 }  }
   
 #define isoctdigit(c) ((c) >= '0' && (c) <= '7')    /* multiple use of arg */  #define isoctdigit(c) ((c) >= '0' && (c) <= '7')    /* multiple use of arg */
   
 int quoted(char **pp)   /* pick up next thing after a \\ */  int quoted(uschar **pp) /* pick up next thing after a \\ */
             /* and increment *pp */              /* and increment *pp */
 {  {
     char *p = *pp;      uschar *p = *pp;
     int c;      int c;
   
     if ((c = *p++) == 't')      if ((c = *p++) == 't')
Line 299  char *cclenter(const char *argp) /* add Line 299  char *cclenter(const char *argp) /* add
     bp = buf;      bp = buf;
     for (i = 0; (c = *p++) != 0; ) {      for (i = 0; (c = *p++) != 0; ) {
         if (c == '\\') {          if (c == '\\') {
             c = quoted((char **) &p);              c = quoted(&p);
         } else if (c == '-' && i > 0 && bp[-1] != 0) {          } else if (c == '-' && i > 0 && bp[-1] != 0) {
             if (*p != 0) {              if (*p != 0) {
                 c = bp[-1];                  c = bp[-1];
                 c2 = *p++;                  c2 = *p++;
                 if (c2 == '\\')                  if (c2 == '\\')
                     c2 = quoted((char **) &p);                      c2 = quoted(&p);
                 if (c > c2) {   /* empty; ignore */                  if (c > c2) {   /* empty; ignore */
                     bp--;                      bp--;
                     i--;                      i--;
Line 748  struct charclass { Line 748  struct charclass {
 } charclasses[] = {  } charclasses[] = {
     { "alnum",  5,  isalnum },      { "alnum",  5,  isalnum },
     { "alpha",  5,  isalpha },      { "alpha",  5,  isalpha },
   #ifndef HAS_ISBLANK
     { "blank",  5,  isspace }, /* was isblank */      { "blank",  5,  isspace }, /* was isblank */
   #else
       { "blank",  5,  isblank },
   #endif
     { "cntrl",  5,  iscntrl },      { "cntrl",  5,  iscntrl },
     { "digit",  5,  isdigit },      { "digit",  5,  isdigit },
     { "graph",  5,  isgraph },      { "graph",  5,  isgraph },
Line 785  int relex(void)  /* lexical analyzer for Line 789  int relex(void)  /* lexical analyzer for
     case ')':      case ')':
         return c;          return c;
     case '\\':      case '\\':
         rlxval = quoted((char **) &prestr);          rlxval = quoted(&prestr);
         return CHAR;          return CHAR;
     default:      default:
         rlxval = c;          rlxval = c;

Removed from v.1.1  
changed lines
  Added in v.1.2


CVSweb interface <joel.bertrand@systella.fr>