57a039f4f2
Unlike original mawk it better supports POSIX regexp (at least it support character classes) and supports utf-8. For this to work the external regular expression library is used - libuxre
39 lines
790 B
Text
39 lines
790 B
Text
$NetBSD: patch-ag,v 1.1 2008/02/06 21:33:54 cheusov Exp $
|
|
|
|
--- main.c.orig 1995-06-10 01:57:19.000000000 +0300
|
|
+++ main.c
|
|
@@ -44,6 +44,10 @@ the GNU General Public License, version
|
|
|
|
/* main.c */
|
|
|
|
+#ifndef LOCAL_REGEXP
|
|
+# include <locale.h>
|
|
+#endif
|
|
+
|
|
#include "mawk.h"
|
|
#include "init.h"
|
|
#include "code.h"
|
|
@@ -53,11 +57,22 @@ the GNU General Public License, version
|
|
short mawk_state ; /* 0 is compiling */
|
|
int exit_code ;
|
|
|
|
+static void initialize_locale (void)
|
|
+{
|
|
+#ifndef LOCAL_REGEXP
|
|
+ setlocale(LC_CTYPE, "");
|
|
+ setlocale(LC_COLLATE, "");
|
|
+ setlocale(LC_MESSAGES, "");
|
|
+ setlocale(LC_NUMERIC, "C");
|
|
+ setlocale(LC_TIME, "");
|
|
+#endif
|
|
+}
|
|
+
|
|
int
|
|
main(argc, argv)
|
|
int argc ; char **argv ;
|
|
{
|
|
-
|
|
+ initialize_locale ();
|
|
initialize(argc, argv) ;
|
|
|
|
parse() ;
|