[BACK]Return to bc.y CVS log [TXT][DIR] Up to [local] / src / usr.bin / bc

Diff for /src/usr.bin/bc/bc.y between version 1.9 and 1.10

version 1.9, 2003/09/29 03:24:27 version 1.10, 2003/09/30 18:46:11
Line 717 
Line 717 
 void  void
 yyerror(char *s)  yyerror(char *s)
 {  {
         if (isspace(*yytext) || !isprint(*yytext))          char    *str, *p;
                 printf("c[%s: %s:%d: %s: ascii char 0x%x unexpected]pc\n",  
                     __progname, filename, lineno, s, *yytext);          if (isspace(yytext[0]) || !isprint(yytext[0]))
                   asprintf(&str, "%s: %s:%d: %s: ascii char 0x%x unexpected",
                       __progname, filename, lineno, s, yytext[0]);
         else          else
                 printf("c[%s: %s:%d: %s: %s unexpected]pc\n",                  asprintf(&str, "%s: %s:%d: %s: %s unexpected",
                     __progname, filename, lineno, s, yytext);                      __progname, filename, lineno, s, yytext);
           if (str == NULL)
                   err(1, "cannot allocate string");
   
           fputs("c[", stdout);
           for (p = str; *p != '\0'; p++) {
                   if (*p == '[' || *p == ']' || *p =='\\')
                           putchar('\\');
                   putchar(*p);
           }
           fputs("]pc\n", stdout);
           free(str);
 }  }
   
 void  void

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10