m4-commit
[Top][All Lists]
Advanced

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

Changes to m4/m4/utility.c,v


From: Eric Blake
Subject: Changes to m4/m4/utility.c,v
Date: Fri, 06 Oct 2006 15:24:11 +0000

CVSROOT:        /sources/m4
Module name:    m4
Changes by:     Eric Blake <ericb>      06/10/06 15:24:10

Index: m4/utility.c
===================================================================
RCS file: /sources/m4/m4/m4/utility.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -b -r1.50 -r1.51
--- m4/utility.c        4 Oct 2006 03:57:00 -0000       1.50
+++ m4/utility.c        6 Oct 2006 15:24:10 -0000       1.51
@@ -76,14 +76,21 @@
 {
   char *endp;
 
-  if (*M4ARG (arg) == 0
-      || (*valuep = strtol (skip_space (context, M4ARG (arg)), &endp, 10),
-         *skip_space (context, endp) != 0))
+  if (*M4ARG (arg) == '\0')
     {
-      m4_warn (context, 0, _("%s: argument %d non-numeric: %s"),
-              M4ARG (0), arg - 1, M4ARG (arg));
+      *valuep = 0;
+      m4_warn (context, 0, _("%s: empty string treated as 0"), M4ARG (0));
+    }
+  else
+    {
+      *valuep = strtol (skip_space (context, M4ARG (arg)), &endp, 10);
+      if (*skip_space (context, endp) != 0)
+       {
+         m4_warn (context, 0, _("%s: non-numeric argument `%s'"),
+                  M4ARG (0), M4ARG (arg));
       return false;
     }
+    }
   return true;
 }
 




reply via email to

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