Index: filters/conffilt.l
--- filters/conffilt.l.orig	2016-12-18 10:42:54.412071000 +0100
+++ filters/conffilt.l	2016-12-18 10:42:54.430550000 +0100
@@ -1,9 +1,6 @@
 %pointer
 %x NORMAL QUOTED
 
-%o 10000
-%a 5000
-
 %{
 
 /*
Index: filters/imakeflt.l
--- filters/imakeflt.l.orig	2016-12-18 10:42:54.128036000 +0100
+++ filters/imakeflt.l	2016-12-18 10:42:54.430694000 +0100
@@ -1,9 +1,6 @@
 %pointer
 %x NORMAL COMMENT QUOTE1 QUOTE2 CCOMMENT
 
-%a 6000
-%o 10000
-
 %{
 
 /*
Index: filters/infofilt.l
--- filters/infofilt.l.orig	2016-12-18 10:42:54.128188000 +0100
+++ filters/infofilt.l	2016-12-18 10:42:54.430809000 +0100
@@ -1,8 +1,6 @@
 %pointer
 %s NORMAL QUOTED QUOTES QUOTE1
 
-%o 6000
-
 %{
 
 /*
Index: filters/latexflt.l
--- filters/latexflt.l.orig	2016-12-18 10:42:54.129012000 +0100
+++ filters/latexflt.l	2016-12-18 10:42:54.430943000 +0100
@@ -1,9 +1,6 @@
 %pointer
 %s sTEXT VERBATIM QUOTE_TT QUOTED MATH MATHC
 
-%o 6000
-%a 4000
-
 %{
 
 /*
Index: filters/lex-filt.l
--- filters/lex-filt.l.orig	2016-12-18 10:42:54.413364000 +0100
+++ filters/lex-filt.l	2016-12-18 10:42:54.431097000 +0100
@@ -1,11 +1,6 @@
 %pointer
 %s RULES RULE1 RULEX RULER STATES ACTIONS ACTION0 ACTION1 ACTION2 ACTION3 CODE CODE1 COMMENT
 
-%a 20000
-%n 10000
-%o 30000
-%p 25000
-
 %{
 
 /*
Index: filters/mailfilt.l
--- filters/mailfilt.l.orig	2016-12-18 10:42:54.129828000 +0100
+++ filters/mailfilt.l	2016-12-18 10:42:54.431215000 +0100
@@ -1,8 +1,6 @@
 %pointer
 %s HEADER BODY
 
-%o 7000
-
 %{
 
 /*
Index: filters/makefilt.l
--- filters/makefilt.l.orig	2016-12-18 10:42:54.130519000 +0100
+++ filters/makefilt.l	2016-12-18 10:42:54.431346000 +0100
@@ -1,9 +1,6 @@
 %pointer
 %x NORMAL COMMENT QUOTE1 QUOTE2
 
-%a 6000
-%o 10000
-
 %{
 
 /*
Index: filters/mcrlfilt.l
--- filters/mcrlfilt.l.orig	2016-12-18 10:42:54.131062000 +0100
+++ filters/mcrlfilt.l	2016-12-18 10:42:54.431454000 +0100
@@ -1,8 +1,6 @@
 %pointer
 %s NORMAL 
 
-%o 6000
-
 %{
 
 /*
Index: filters/mms-filt.l
--- filters/mms-filt.l.orig	2016-12-18 10:42:54.131490000 +0100
+++ filters/mms-filt.l	2016-12-18 10:42:54.431567000 +0100
@@ -1,6 +1,4 @@
 %pointer
-%a 5000
-%o 6000
 
 %{
 
Index: filters/ps-filt.l
--- filters/ps-filt.l.orig	2016-12-18 10:42:54.414429000 +0100
+++ filters/ps-filt.l	2016-12-18 10:42:54.431680000 +0100
@@ -1,8 +1,6 @@
 %pointer
 %x NORMAL LIT_TEXT HEX_TEXT B85_TEXT RAW_TEXT RAW_VIEW
 
-%o 6000
-
 %{
 
 /*
Index: filters/rpm-filt.l
--- filters/rpm-filt.l.orig	2016-12-18 10:42:54.415024000 +0100
+++ filters/rpm-filt.l	2016-12-18 10:43:17.835840000 +0100
@@ -1,11 +1,6 @@
 %pointer
 %x META sTEXT NORMAL ONELINE HEREDOC SSTRING DSTRING QUOTED2 SUBST NOTE
 
-%e 2000
-%p 3000
-%o 10000
-%a 10000
-
 %{
 
 /*
Index: filters/sccsfilt.l
--- filters/sccsfilt.l.orig	2016-12-18 10:42:54.134289000 +0100
+++ filters/sccsfilt.l	2016-12-18 10:42:55.480956000 +0100
@@ -1,9 +1,6 @@
 %pointer
 %s sDELETE INSERT
 
-%a 10000
-%o 10000
-
 %{
 
 /*
Index: filters/sql-filt.l
--- filters/sql-filt.l.orig	2016-12-18 10:42:54.135357000 +0100
+++ filters/sql-filt.l	2016-12-18 10:42:56.113612000 +0100
@@ -210,11 +210,25 @@
 
 %%
 
+static void begin_oneliner(void);
+static void finish_oneliner(void);
+
+static int
+is_oneliner(const char *name)
+{
+    const char *flags = ci_keyword_flag(name);
+    int result = 0;
+    if (flags != 0) {
+	result = (strchr(flags, '1') != 0);
+    }
+    return result;
+}
+
 static void
 begin_oneliner(void)
 {
     new_state(ONE_LINE);
-    next_line = LEAD;
+    next_line = 0;
     flt_bfr_begin(String_attr);
 }
 
@@ -223,18 +237,7 @@
 {
     flt_bfr_finish();
     new_state(next_line);
-    next_line = LEAD;
-}
-
-static int
-is_oneliner(const char *name)
-{
-    const char *flags = ci_keyword_flag(name);
-    int result = 0;
-    if (flags != 0) {
-	result = (strchr(flags, '1') != 0);
-    }
-    return result;
+    next_line = 0;
 }
 
 static void
Index: filters/tcl-filt.l
--- filters/tcl-filt.l.orig	2016-12-18 10:42:54.415640000 +0100
+++ filters/tcl-filt.l	2016-12-18 10:42:56.113165000 +0100
@@ -1,8 +1,6 @@
 %pointer
 %s VERB NOTE REGOPT REGARG ARGS DATA DQUOTED
 
-%a 5000
-
 %{
 
 /*
Index: filters/txt-filt.l
--- filters/txt-filt.l.orig	2016-12-18 10:42:54.415783000 +0100
+++ filters/txt-filt.l	2016-12-18 10:42:56.113294000 +0100
@@ -1,9 +1,6 @@
 %pointer
 %s sTEXT NOTE QUOTED QUOTES
 
-%a 10000
-%o 10000
-
 %{
 
 /*
Index: filters/vilefilt.l
--- filters/vilefilt.l.orig	2016-12-18 10:42:54.137409000 +0100
+++ filters/vilefilt.l	2016-12-18 10:42:56.113440000 +0100
@@ -1,9 +1,6 @@
 %pointer
 %s NORMAL ACTION REGISTER SETTINGS MAJORMODE_NAME SUBMODE_NAME SUBMODE_VALS WITH_DEFS LITERAL XCOLOR XCOLOR2
 
-%o 10000
-%a 6000
-
 %{
 
 /*
Index: tcap.h
--- tcap.h.orig	2016-12-18 10:42:54.188322000 +0100
+++ tcap.h	2016-12-18 10:42:54.430409000 +0100
@@ -19,11 +19,13 @@
 #define MK other_MK	/* workaround for bug in NetBSD 1.5 curses */
 
 /* _XOPEN_SOURCE_EXTENDED is needed for the wide-character X/Open functions */
+#if 0
 #ifdef NCURSES
 #  ifndef _XOPEN_SOURCE_EXTENDED
 #    define _XOPEN_SOURCE_EXTENDED 1
 #  endif
 #endif
+#endif
 
 /*
  * Workaround for breakage in FreeBSD's header files (updates to wchar.h were
