From: Gilles D. <gr...@sc...> - 2003-11-18 17:50:13
|
According to Gilles Detillieux: > According to BOOTH, Nicholas, FM: > > 3] If there is _not_ a return after the last line in the config file then > > htsearch causes a cgi error. Results from apache eror log: > > > > Unknown char in line 224: #[Fri Nov 14 23:51:46 2003] [error] [client > > 147.114.74.200] malformed header from script. Bad header=syntax error: > > /var/www/cgi-bin/htsearch32 > > That's because you're using the wrong editor. If you use vi, it will > ensure that the last line ends with a newline. ;-) Seriously, in 3.2 we > moved from a simple format parsed directly in some C++ code, to a more > elaborate format allowing blocks of config attributes. That required > us going with a more complex parser written in flex and bison. I don't > know how much control we have over how these will deal with an improperly > terminated final line -- it may be out of our hands. I'll see if I can > figure something out. I don't see anything in HtConfiguration.cc, conf_lexer.lxx, or conf_parser.yxx that would allow us to intercept the unterminated last line and add the newline to it, so it would be taken by the lexer to be a full line. That means the only way to deal with this, short of telling users "tough luck, just properly terminate your files," would be to rewrite the grammar in conf_lexer.lxx to be less dependent on newlines. Maybe define an EOL character class that can be \n or EOF, and use that instead of \n everywhere? But would this break the current EOF handling, or something else? I don't understand lex/flex enough to venture into this. -- Gilles R. Detillieux E-mail: <gr...@sc...> Spinal Cord Research Centre WWW: http://www.scrc.umanitoba.ca/ Dept. Physiology, U. of Manitoba Winnipeg, MB R3E 3J7 (Canada) |