diff --git a/qse/cmd/http/httpd.c b/qse/cmd/http/httpd.c index 23c5df3f..4a9253cf 100644 --- a/qse/cmd/http/httpd.c +++ b/qse/cmd/http/httpd.c @@ -1478,7 +1478,7 @@ static int open_config_file (qse_httpd_t* httpd) } qse_xli_getopt (httpd_xtn->xli, QSE_XLI_TRAIT, &trait); - trait |= QSE_XLI_VALIDATE; + trait |= QSE_XLI_MULSEGSTR | QSE_XLI_VALIDATE; qse_xli_setopt (httpd_xtn->xli, QSE_XLI_TRAIT, &trait); for (i = 0; i < QSE_COUNTOF(defs); i++) diff --git a/qse/cmd/xli/xli.c b/qse/cmd/xli/xli.c index b4842052..325f2109 100644 --- a/qse/cmd/xli/xli.c +++ b/qse/cmd/xli/xli.c @@ -134,6 +134,8 @@ static void print_usage (QSE_FILE* out, int argc, qse_char_t* argv[]) qse_fprintf (out, QSE_T(" -a allow a key alias\n")); qse_fprintf (out, QSE_T(" -f keep file inclusion info\n")); qse_fprintf (out, QSE_T(" -t keep comment text\n")); + qse_fprintf (out, QSE_T(" -s allow multi-segmented strings\n")); + qse_fprintf (out, QSE_T(" -v perform validation\n")); qse_fprintf (out, QSE_T(" -m number specify the maximum amount of memory to use in bytes\n")); #if defined(QSE_BUILD_DEBUG) qse_fprintf (out, QSE_T(" -X number fail the number'th memory allocation\n")); @@ -160,9 +162,9 @@ static int handle_args (int argc, qse_char_t* argv[]) static qse_opt_t opt = { #if defined(QSE_BUILD_DEBUG) - QSE_T("hi:o:uaftvm:X:"), + QSE_T("hi:o:uaftsvm:X:"), #else - QSE_T("hi:o:uaftvm:"), + QSE_T("hi:o:uaftsvm:"), #endif lng }; @@ -220,6 +222,10 @@ static int handle_args (int argc, qse_char_t* argv[]) g_trait |= QSE_XLI_KEEPTEXT; break; + case QSE_T('s'): + g_trait |= QSE_XLI_MULSEGSTR; + break; + case QSE_T('v'): g_trait |= QSE_XLI_VALIDATE; break; diff --git a/qse/include/qse/xli/xli.h b/qse/include/qse/xli/xli.h index 823b96b8..ce2e9333 100644 --- a/qse/include/qse/xli/xli.h +++ b/qse/include/qse/xli/xli.h @@ -79,13 +79,14 @@ typedef enum qse_xli_opt_t qse_xli_opt_t; enum qse_xli_trait_t { - QSE_XLI_KEYNODUP = (1 << 1), - QSE_XLI_KEYALIAS = (1 << 2), + QSE_XLI_KEYNODUP = (1 << 1), + QSE_XLI_KEYALIAS = (1 << 2), - QSE_XLI_KEEPTEXT = (1 << 3), /**< keep comment text */ - QSE_XLI_KEEPFILE = (1 << 4), /**< keep inclusion file info */ + QSE_XLI_KEEPTEXT = (1 << 3), /**< keep comment text */ + QSE_XLI_KEEPFILE = (1 << 4), /**< keep inclusion file info */ - QSE_XLI_VALIDATE = (1 << 5) + QSE_XLI_MULSEGSTR = (1 << 5), /**< support multi-segmented string */ + QSE_XLI_VALIDATE = (1 << 6) }; typedef enum qse_xli_trait_t qse_xli_trait_t; diff --git a/qse/lib/xli/read.c b/qse/lib/xli/read.c index c9540e6b..ef4b1b18 100644 --- a/qse/lib/xli/read.c +++ b/qse/lib/xli/read.c @@ -734,7 +734,7 @@ static int read_pair (qse_xli_t* xli) curstrseg = (qse_xli_str_t*)pair->val; if (get_token (xli) <= -1) goto oops; - if (MATCH(xli, TOK_COMMA)) + if ((xli->opt.trait & QSE_XLI_MULSEGSTR) && MATCH(xli, TOK_COMMA)) { /* multi-segmented string */ do