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

Diff for /src/usr.bin/awk/b.c between version 1.16 and 1.17

version 1.16, 2010/06/13 17:58:19 version 1.17, 2011/09/28 19:27:18
Line 232 
Line 232 
 /* 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 246 
Line 246 
                 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 300 
Line 300 
         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 734 
Line 734 
   
 #ifndef HAS_ISBLANK  #ifndef HAS_ISBLANK
   
 int (isblank)(int c)  int (xisblank)(int c)
 {  {
         return c==' ' || c=='\t';          return c==' ' || c=='\t';
 }  }
Line 748 
Line 748 
 } charclasses[] = {  } charclasses[] = {
         { "alnum",      5,      isalnum },          { "alnum",      5,      isalnum },
         { "alpha",      5,      isalpha },          { "alpha",      5,      isalpha },
   #ifndef HAS_ISBLANK
           { "blank",      5,      isspace }, /* was isblank */
   #else
         { "blank",      5,      isblank },          { "blank",      5,      isblank },
   #endif
         { "cntrl",      5,      iscntrl },          { "cntrl",      5,      iscntrl },
         { "digit",      5,      isdigit },          { "digit",      5,      isdigit },
         { "graph",      5,      isgraph },          { "graph",      5,      isgraph },
Line 785 
Line 789 
         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;

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17