The yyerror() in read_config_scanner.y uses 'current_yacc_file' which is set nowhere. Not sure if this patch is correct, but now the error reporting looks better:

--- cherokee-0.4.31b8\cherokee\module_read_config.c Sat Jan 28 18:54:19 2006
+++ cherokee\module_read_config.c Wed Feb 15 12:46:53 2006
@@ -34,6 +34,7 @@
#include "mime.h"
#include "util.h"

+extern char *current_yacc_file;

cherokee_module_info_t MODULE_INFO(read_config) = {
 cherokee_generic,                  /* type     */
@@ -78,6 +79,7 @@
 }
if (S_ISREG(info.st_mode)) {
+  current_yacc_file = path;
  cherokee_buffer_read_file (buf, path);
  return ret_ok;

@@ -107,6 +109,7 @@
   ret = cherokee_buffer_add_va (&full_new, "%s/%s", path, entry->d_name);
   if (unlikely (ret != ret_ok)) return ret;

+   current_yacc_file = full_new.buf;
   cherokee_buffer_read_file (buf, full_new.buf);
   cherokee_buffer_mrproper (&full_new);
  }
@@ -207,6 +210,7 @@
 ret_t             ret;
 cherokee_buffer_t config = CHEROKEE_BUF_INIT;
+ current_yacc_file = filename;
 ret = cherokee_buffer_read_file (&config, filename);
 if (ret != ret_ok) goto go_out;

------------------

The read_config_scanner.l doesn't handle this case:
# comment<EOF>

This patch fixes that:

--- cherokee-0.4.31b8\cherokee\read_config_scanner.l Sat Feb 04 00:30:12 2006
+++ cherokee\read_config_scanner.l Wed Feb 15 12:52:33 2006
@@ -32,7 +32,7 @@

ws              [ \t]+
integer         [-+]?[0-9]+
-comment         #.*$
+comment         #.*
fpath_win       ([a-zA-Z]:[^\"\n\r ]*)
fpath           (\/[^\"\n\r ]*)|{fpath_win}
qstring         \"[^\"\{\}\n\r]*\"

--gv

_______________________________________________
Cherokee mailing list
[email protected]
http://www.alobbs.com/cgi-bin/mailman/listinfo/cherokee

Reply via email to