bugvile, a vi-compatible text editor - Bugs: bug #24532, Problem with definitions in...


bug #24532: Problem with definitions in sql-filt.l

Submitted by:  None
Submitted on:  Sat 11 Oct 2008 10:16:37 PM UTC  
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Fri 04 Sep 2009 10:14:09 PM UTC, comment #6:

thanks - closing then

Thomas Dickey <dickey>
Project Administrator
Fri 04 Sep 2009 05:07:38 PM UTC, comment #5:

I can confirm that the problem is fixed in 9.7t on OS-X 10.5 and Ubuntu Server 8.04.

Ingmar Ellenberger <iellenberger>
Tue 19 May 2009 12:08:56 AM UTC, comment #4:

The list of #define's corresponds to the "%x" states.
Perhaps the version of lex/flex is broken in some
way (though I'd added configure checks for some of that).

Thomas Dickey <dickey>
Project Administrator
Wed 01 Apr 2009 06:31:12 PM UTC, comment #3:

Looks like the copy-and-paste messed up. Correct the line below with this (replace the [star] with a '*'):

@@ -33,31 +32,15 @@ static int next_line; /* state after one-line SQL[star]Plus */

Ingmar Ellenberger <iellenberger>
Wed 01 Apr 2009 06:27:05 PM UTC, comment #2:

Had the same problem on OS-X and Ubuntu Server 8.04 on patchlevel 9.7m. To fix, I moved a few things around and declared prototyped in filters/sql-filt.l. Here's the patch from my Git repo:

Fixing SQL filter for compilation error

diff --git a/vile-9.7/filters/sql-filt.l b/vile-9.7/filters/sql-filt.l
index e4b5351..6c7989a 100644
--- a/vile-9.7/filters/sql-filt.l
+++ b/vile-9.7/filters/sql-filt.l
@@ -20,7 +20,6 @@ DefineOptFilter("sql", "d");
#define new_state(state) saved_state = began_state; set_state(state)
#define old_state() set_state(saved_state);

static char *Action_attr;
static char *Comment_attr;
static char *Error_attr;
@@ -33,31 +32,15 @@ static int next_line; /* state after one-line SQLPlus /
static int began_state;
static int saved_state;

-static void
- new_state(ONE_LINE);
- next_line = LEAD;
- flt_bfr_begin(String_attr);
+static void begin_oneliner(void);
+static void finish_oneliner(void);
+static int is_oneliner(char *name);
+static void init_filter(int before GCC_UNUSED);
+static void do_filter(FILE *inputs);

-static void
- flt_bfr_finish();
- new_state(next_line);
- next_line = LEAD;
-static int
-is_oneliner(char *name)
- char *flags = ci_keyword_flag(name);
- int result = 0;
- if (flags != 0)
- result = (strchr(flags, '1') != 0);
- return result;
+static void free_filter(void);


@@ -227,6 +210,32 @@ HOSTVAR ":"{IDENT}

static void
+ new_state(ONE_LINE);
+ next_line = LEAD;
+ flt_bfr_begin(String_attr);
+static void
+ flt_bfr_finish();
+ new_state(next_line);
+ next_line = LEAD;
+static int
+is_oneliner(char *name)
+ char *flags = ci_keyword_flag(name);
+ int result = 0;
+ if (flags != 0)
+ result = (strchr(flags, '1') != 0);
+ return result;
+static void
init_filter(int before GCC_UNUSED)
(void) before;

Ingmar Ellenberger <iellenberger>
Sat 11 Oct 2008 10:32:40 PM UTC, comment #1:

perhaps you're missing the 9.7a patch (since that seems
to be the last change I made to that file). You "should"
be able to apply a-e patches on top of 9.7 to get 9.7e.
There's a tar of the 9.7e source in


which you may find useful for comparison.

Thomas Dickey <dickey>
Project Administrator
Sat 11 Oct 2008 10:16:37 PM UTC, original submission:

I maintain (more or less by default) the vile package in Mandriva Linux. Trying to bump it to 9.7 (patch e), it fails to build due to some definition issues in sql-filt.l . First it complains that ONE_LINE is undeclared. If you fix that, it complains that LEAD is undeclared, and so on.

I 'fixed' this by just copying the entire #define block for those variables from sql-filt.c into sql-filt.l:

#define INITIAL 0
#define LEAD 1
#define BODY 2
#define MORE 3
#define COMMENT0 4
#define COMMENT 5
#define INLINE_CMT 6
#define SERVER 7
#define ONE_LINE 8

I'm not sure if it's the right fix, but it makes the compile complete, and the built vile seems to work in a quick test.

This is with gcc 4.3.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by iellenberger (Posted a comment)
  • -unavailable- added by dickey (Posted a comment)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 04 Sep 2009 10:14:20 PM UTCdickeyStatusNone=>Fixed

    Back to the top

    Powered by Savane 3.1-cleanup1