[BACK]Return to expr.y CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / bin / expr

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/bin/expr/expr.y between version 1.6 and 1.7

version 1.6, 1993/06/14 19:59:07 version 1.7, 1993/07/20 00:29:41
Line 542  struct val *a, *b;
Line 542  struct val *a, *b;
         regmatch_t rm[SE_MAX];          regmatch_t rm[SE_MAX];
         char errbuf[256];          char errbuf[256];
         int eval;          int eval;
         char *newpat;  
         struct val *v;          struct val *v;
   
         /* patterns are anchored to the beginning of the line */          /* coerce to both arguments to strings */
         newpat = malloc (strlen (b->u.s) + 2);          to_string(a);
         strcpy (newpat, "^");          to_string(b);
         strcat (newpat, b->u.s);  
   
         /* compile regular expression */          /* compile regular expression */
         if ((eval = regcomp (&rp, newpat, 0)) != 0) {          if ((eval = regcomp (&rp, b->u.s, 0)) != 0) {
                 regerror (eval, &rp, errbuf, sizeof(errbuf));                  regerror (eval, &rp, errbuf, sizeof(errbuf));
                 fprintf (stderr, "expr: %s\n", errbuf);                  fprintf (stderr, "expr: %s\n", errbuf);
                 exit (2);                  exit (2);

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

CVSweb <webmaster@jp.NetBSD.org>