diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-07-29 17:29:33 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-07-29 17:36:03 +0300 |
commit | 55ed5436a098f478bc4c4326fa3ff564ef154b06 (patch) | |
tree | a1bc8491408f62130809158ced1363ee5b62bb57 | |
parent | d5ae2f7493485606de05ad3c342412310f3c9352 (diff) | |
download | dico-55ed5436a098f478bc4c4326fa3ff564ef154b06.tar.gz dico-55ed5436a098f478bc4c4326fa3ff564ef154b06.tar.bz2 |
Upgrade grecs
* grecs: Pull latest commit.
* dicod/main.c (config_init): Set GRECS_OPTION_QUOTED_STRING_CONCAT
option.
* dicod/accesslog.c: Use %td specifier to print ptrdiff_t values.
* dicod/server.c (handle_connection): Return meaningful status
in single_process mode.
* modules/gcide/idxgcide.l: Set option noinput.
* modules/gcide/markup.l: Likewise.
-rw-r--r-- | dicod/accesslog.c | 8 | ||||
-rw-r--r-- | dicod/main.c | 5 | ||||
-rw-r--r-- | dicod/server.c | 6 | ||||
m--------- | grecs | 0 | ||||
-rw-r--r-- | modules/gcide/idxgcide.l | 1 | ||||
-rw-r--r-- | modules/gcide/markup.l | 5 |
6 files changed, 14 insertions, 11 deletions
diff --git a/dicod/accesslog.c b/dicod/accesslog.c index 1c93c59..5c1720a 100644 --- a/dicod/accesslog.c +++ b/dicod/accesslog.c @@ -1,8 +1,8 @@ /* This file is part of GNU Dico. - Copyright (C) 2008, 2010, 2012 Sergey Poznyakoff + Copyright (C) 2008, 2010, 2012, 2016 Sergey Poznyakoff GNU Dico is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. @@ -481,13 +481,13 @@ compile_access_log() p++; } else if (*p == '{') { char *q = strchr(p + 1, '}'); if (!q) { dico_log(L_ERR, 0, - _("log format error (near char %ld): " + _("log format error (near char %td): " "missing terminating `}'"), p - access_log_format); add_instr(alog_print, p - 1, 2); fmt = p + 1; continue; } @@ -496,21 +496,21 @@ compile_access_log() p = q + 1; } tptr = find_alog_entry(*p); if (!tptr) { dico_log(L_ERR, 0, - _("log format error (near char %ld): " + _("log format error (near char %td): " "unknown format char `%c'"), p - access_log_format, *p); add_instr(alog_print, fmt, p - fmt + 1); } else { if (arg && !tptr->allow_fmt) { dico_log(L_ERR, 0, - _("log format warning (near char %ld): " + _("log format warning (near char %td): " "format char `%c' does not " "take arguments"), p - access_log_format, *p); arg = NULL; } diff --git a/dicod/main.c b/dicod/main.c index 42c968c..6ee5e8d 100644 --- a/dicod/main.c +++ b/dicod/main.c @@ -1,8 +1,8 @@ /* This file is part of GNU Dico. - Copyright (C) 1998-2000, 2008, 2010, 2012 Sergey Poznyakoff + Copyright (C) 1998-2000, 2008, 2010, 2012, 2016 Sergey Poznyakoff GNU Dico is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. @@ -740,13 +740,13 @@ mime_headers_cb (enum grecs_callback_command cmd, } if (dico_header_parse(pasc, value->v.string)) grecs_error(locus, 0, _("cannot parse headers: %s"), strerror(errno)); - if (enc = dico_assoc_find(*pasc, CONTENT_TRANSFER_ENCODING_HEADER)) { + if ((enc = dico_assoc_find(*pasc, CONTENT_TRANSFER_ENCODING_HEADER))) { if (!(strcmp(enc, "quoted-printable") == 0 || strcmp(enc, "base64") == 0 || strcmp(enc, "8bit") == 0)) grecs_error(locus, 0, _("unknown encoding type: %s"), enc); } @@ -1342,12 +1342,13 @@ config_init() { grecs_include_path_setup (DEFAULT_VERSION_INCLUDE_DIR, DEFAULT_INCLUDE_DIR, NULL); grecs_preprocessor = DEFAULT_PREPROCESSOR; grecs_log_to_stderr = 1; grecs_default_port = htons(DICO_DICT_PORT); + grecs_parser_options = GRECS_OPTION_QUOTED_STRING_CONCAT; } void config_parse() { struct grecs_node *tree; diff --git a/dicod/server.c b/dicod/server.c index 8f81ae4..60edb1f 100644 --- a/dicod/server.c +++ b/dicod/server.c @@ -1,8 +1,8 @@ /* This file is part of GNU Dico. - Copyright (C) 2008, 2010, 2012 Sergey Poznyakoff + Copyright (C) 2008, 2010, 2012, 2016 Sergey Poznyakoff GNU Dico is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. @@ -403,19 +403,19 @@ handle_connection(int n) SWRITE(connfd, ACCESS_DENIED_MSG); close(connfd); return 0; } if (single_process) { - int status; dico_stream_t str = dicod_iostream(connfd, connfd); if (str) { status = dicod_loop(str); dico_stream_close(str); dico_stream_destroy(&str); - } + } else + status = -1; } else { pid_t pid = fork(); if (pid == -1) { dico_log(L_ERR, errno, "fork"); SWRITE(connfd, TEMP_FAIL_MSG); } else if (pid == 0) { diff --git a/grecs b/grecs -Subproject d51e1365118ce87016a39bd94437e31b35b8d30 +Subproject 95b9dbb21aa2a7721c091aa79c680b4531fa804 diff --git a/modules/gcide/idxgcide.l b/modules/gcide/idxgcide.l index b48b11c..7dba32f 100644 --- a/modules/gcide/idxgcide.l +++ b/modules/gcide/idxgcide.l @@ -168,12 +168,13 @@ flush_headwords() #define BEGIN_HEADWORD(end) \ { retstate = YYSTATE; endtag = (end); BEGIN(HEADWORD); } %} %option 8bit %option nounput +%option noinput %x HEADWORD MHW COMMENT HTMLCOM XD [0-9a-f] %% <INITIAL>{ diff --git a/modules/gcide/markup.l b/modules/gcide/markup.l index dbe6ea5..c4dabd8 100644 --- a/modules/gcide/markup.l +++ b/modules/gcide/markup.l @@ -1,9 +1,9 @@ %top { /* This file is part of GNU Dico. - Copyright (C) 2012 Sergey Poznyakoff + Copyright (C) 2012, 2016 Sergey Poznyakoff GNU Dico is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. @@ -256,12 +256,13 @@ pop_tag(const char *tagstr, size_t taglen) dico_log(L_WARN, 0, "%u: unexpected close tag", token_beg); } %} %option 8bit %option nounput +%option noinput %x COMMENT XD [0-9a-f] %% <INITIAL>{ @@ -467,13 +468,13 @@ gcide_markup_parse(char const *text, size_t len, int dbg) memerr("gcide lexer"); tag->tag_type = gcide_content_text; tag->tag_v.textpos = text_segment_finish(); append_tag(tag); } - while (p = dico_list_pop(tagstk)) + while ((p = dico_list_pop(tagstk))) /* FIXME: Report unclosed tag */ current_tag = p; dico_list_destroy(&tagstk); if (!current_tag) { |