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

Diff for /src/usr.bin/awk/lex.c between version 1.28 and 1.29

version 1.28, 2022/09/01 15:21:28 version 1.29, 2023/09/09 18:59:43
Line 427 
Line 427 
                                 break;                                  break;
   
                         case 'x':       /* hex  \x0-9a-fA-F + */                          case 'x':       /* hex  \x0-9a-fA-F + */
                             {   char xbuf[100], *px;                              {
                                 for (px = xbuf; (c = input()) != 0 && px-xbuf < 100-2; ) {                                  int i;
                                         if (isdigit(c)  
                                          || (c >= 'a' && c <= 'f')                                  n = 0;
                                          || (c >= 'A' && c <= 'F'))                                  for (i = 1; i <= 2; i++) {
                                                 *px++ = c;                                          c = input();
                                         else                                          if (c == 0)
                                                 break;                                                  break;
                                           if (isxdigit(c)) {
                                                   c = tolower(c);
                                                   n *= 16;
                                                   if (isdigit(c))
                                                           n += (c - '0');
                                                   else
                                                           n += 10 + (c - 'a');
                                           } else
                                                   break;
                                 }                                  }
                                 *px = 0;                                  if (n)
                                 unput(c);                                          *bp++ = n;
                                 sscanf(xbuf, "%x", (unsigned int *) &n);                                  else
                                 *bp++ = n;                                          unput(c);
                                 break;                                  break;
                             }                              }
   

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29