main.c.diff2   [plain text]


--- main.c.orig	2008-11-12 11:50:29.000000000 -0800
+++ main.c	2008-11-12 11:42:30.000000000 -0800
@@ -34,6 +34,12 @@
 #include "awk.h"
 #include "ytab.h"
 
+#ifdef __APPLE__
+#include "get_compat.h"
+#else
+#define COMPAT_MODE(func, mode) 1
+#endif
+
 extern	char	**environ;
 extern	int	nfields;
 
@@ -52,6 +58,7 @@
 int	curpfile = 0;	/* current filename */
 
 int	safe	= 0;	/* 1 => "safe" mode */
+int	Unix2003_compat;
 
 int main(int argc, char *argv[])
 {
@@ -66,6 +73,7 @@
 		  cmdname);
 		exit(1);
 	}
+	Unix2003_compat = COMPAT_MODE("bin/awk", "unix2003");
 	signal(SIGFPE, fpecatch);
 	yyin = NULL;
 	symtab = makesymtab(NSYMTAB/NSYMTAB);