m4-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changes to m4/src/Attic/builtin.c,v [branch-1_4]


From: Eric Blake
Subject: Changes to m4/src/Attic/builtin.c,v [branch-1_4]
Date: Thu, 09 Aug 2007 13:39:11 +0000

CVSROOT:        /sources/m4
Module name:    m4
Branch:         branch-1_4
Changes by:     Eric Blake <ericb>      07/08/09 13:39:10

Index: src/builtin.c
===================================================================
RCS file: /sources/m4/m4/src/Attic/builtin.c,v
retrieving revision 1.1.1.1.2.61
retrieving revision 1.1.1.1.2.62
diff -u -b -r1.1.1.1.2.61 -r1.1.1.1.2.62
--- src/builtin.c       4 Aug 2007 20:40:11 -0000       1.1.1.1.2.61
+++ src/builtin.c       9 Aug 2007 13:39:10 -0000       1.1.1.1.2.62
@@ -890,13 +890,16 @@
 {
   symbol *s;
   builtin_func *b;
+  int i;
 
-  if (bad_argc (argv[0], argc, 2, 2))
+  if (bad_argc (argv[0], argc, 2, -1))
     return;
 
-  s = lookup_symbol (ARG (1), SYMBOL_LOOKUP);
+  for (i = 1; i < argc; i++)
+    {
+      s = lookup_symbol (ARG (i), SYMBOL_LOOKUP);
   if (s == NULL)
-    return;
+       continue;
 
   switch (SYMBOL_TYPE (s))
     {
@@ -910,19 +913,21 @@
       b = SYMBOL_FUNC (s);
       if (b == m4_placeholder)
        M4ERROR ((warning_status, 0, "\
-builtin `%s' requested by frozen file is not supported", ARG (1)));
+builtin `%s' requested by frozen file is not supported", ARG (i)));
+         else if (argc != 2)
+           M4ERROR ((warning_status, 0,
+                     "Warning: cannot concatenate builtin `%s'",
+                     ARG (i)));
       else
        push_macro (b);
       break;
 
-    case TOKEN_VOID:
-      break;
-
     default:
       M4ERROR ((warning_status, 0,
                "INTERNAL ERROR: bad symbol type in m4_defn ()"));
       abort ();
     }
+    }
 }
 
 /*------------------------------------------------------------------------.
@@ -1898,16 +1903,16 @@
        case '7': case '8': case '9':
          ch -= '0';
          if (regs->num_regs - 1 <= ch)
-           M4ERROR ((warning_status, 0, "\
-Warning: sub-expression %d not present", ch));
+           M4ERROR ((warning_status, 0,
+                     "Warning: sub-expression %d not present", ch));
          else if (regs->end[ch] > 0)
            obstack_grow (obs, victim + regs->start[ch],
                          regs->end[ch] - regs->start[ch]);
          break;
 
        case '\0':
-         M4ERROR ((warning_status, 0, "\
-Warning: trailing \\ ignored in replacement"));
+         M4ERROR ((warning_status, 0,
+                   "Warning: trailing \\ ignored in replacement"));
          return;
 
        default:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]