m4-commit
[Top][All Lists]
Advanced

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

Changes to m4/modules/gnu.c,v


From: Eric Blake
Subject: Changes to m4/modules/gnu.c,v
Date: Tue, 14 Nov 2006 05:58:03 +0000

CVSROOT:        /sources/m4
Module name:    m4
Changes by:     Eric Blake <ericb>      06/11/14 05:58:01

Index: modules/gnu.c
===================================================================
RCS file: /sources/m4/m4/modules/gnu.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -b -r1.67 -r1.68
--- modules/gnu.c       11 Nov 2006 16:21:25 -0000      1.67
+++ modules/gnu.c       14 Nov 2006 05:58:01 -0000      1.68
@@ -825,29 +825,15 @@
 
 /* This contains macro which implements syncoutput() which takes one arg
      1, on, yes - turn on sync lines
-     0, off, no - turn off sync lines
+     0, off, no, blank - turn off sync lines
      everything else is silently ignored  */
 
 /**
- * syncoutput(SYNC?)
+ * syncoutput(TRUTH)
  **/
 M4BUILTIN_HANDLER (syncoutput)
 {
-  const char *arg = M4ARG (1);
-
-  if (arg[0] == '\0'
-      || arg[0] == '0'
-      || arg[0] == 'n'
-      || arg[0] == 'N'
-      || ((arg[0] == 'o' || arg[0] == 'O')
-         && (arg[1] == 'f' || arg[1] == 'F')))
-    m4_set_sync_output_opt (context, false);
-  else if (arg[0] == '1'
-          || arg[0] == 'y'
-          || arg[0] == 'Y'
-          || ((arg[0] == 'o' || arg[0] == 'O')
-              && (arg[1] == 'n' || arg[1] == 'N')))
-    m4_set_sync_output_opt (context, true);
-  else
-    m4_warn (context, 0, _("%s: unknown directive `%s'"), M4ARG (0), arg);
+  bool value = m4_get_syncoutput_opt (context);
+  value = m4_parse_truth_arg (context, M4ARG (1), M4ARG (0), value);
+  m4_set_syncoutput_opt (context, value);
 }




reply via email to

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