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

Diff for /src/usr.bin/m4/gnum4.c between version 1.50 and 1.51

version 1.50, 2015/04/29 00:13:26 version 1.51, 2017/06/15 13:48:42
Line 35 
Line 35 
 #include <err.h>  #include <err.h>
 #include <paths.h>  #include <paths.h>
 #include <regex.h>  #include <regex.h>
   #include <stdarg.h>
 #include <stddef.h>  #include <stddef.h>
 #include <stdlib.h>  #include <stdlib.h>
 #include <stdint.h>  #include <stdint.h>
Line 234 
Line 235 
 }  }
   
 static char *  static char *
 getstring()  getstring(void)
 {  {
         addchar('\0');          addchar('\0');
         current = 0;          current = 0;
Line 255 
Line 256 
         m4errx(1, "regular expression error in %s: %s.", source, errbuf);          m4errx(1, "regular expression error in %s: %s.", source, errbuf);
 }  }
   
   /* warnx() plus check to see if we need to change exit code or exit.
    * -E flag functionality.
    */
   void
   m4_warnx(const char *fmt, ...)
   {
           va_list ap;
   
           va_start(ap, fmt);
           vwarnx(fmt, ap);
           va_end(ap);
   
           if (fatal_warns)
                   exit(1);
           if (error_warns)
                   exit_code = 1;
   }
   
 static void  static void
 add_sub(int n, const char *string, regex_t *re, regmatch_t *pm)  add_sub(int n, const char *string, regex_t *re, regmatch_t *pm)
 {  {
         if (n > re->re_nsub)          if (n > re->re_nsub)
                 warnx("No subexpression %d", n);                  m4_warnx("No subexpression %d", n);
         /* Subexpressions that did not match are          /* Subexpressions that did not match are
          * not an error.  */           * not an error.  */
         else if (pm[n].rm_so != -1 &&          else if (pm[n].rm_so != -1 &&
Line 442 
Line 461 
 dopatsubst(const char *argv[], int argc)  dopatsubst(const char *argv[], int argc)
 {  {
         if (argc <= 3) {          if (argc <= 3) {
                 warnx("Too few arguments to patsubst");                  m4_warnx("Too few arguments to patsubst");
                 return;                  return;
         }          }
         /* special case: empty regexp */          /* special case: empty regexp */
Line 494 
Line 513 
         const char *source;          const char *source;
   
         if (argc <= 3) {          if (argc <= 3) {
                 warnx("Too few arguments to regexp");                  m4_warnx("Too few arguments to regexp");
                 return;                  return;
         }          }
         /* special gnu case */          /* special gnu case */

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.51