aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2017-01-01 06:21:11 +0100
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2017-01-01 06:21:11 +0100
commit463f6bd5a7f74827427b431452b0720f7be3bd62 (patch)
treec0dba760e5f7ff0df2aafc916c4bb2f41b07ece4 /src
parent2442ee791e0ab49e1897b45191e021b81dd8be3b (diff)
downloadblogc-463f6bd5a7f74827427b431452b0720f7be3bd62.tar.gz
blogc-463f6bd5a7f74827427b431452b0720f7be3bd62.tar.bz2
blogc-463f6bd5a7f74827427b431452b0720f7be3bd62.zip
config-parser: only allow double-quoted values
Diffstat (limited to 'src')
-rw-r--r--src/common/config-parser.c35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/common/config-parser.c b/src/common/config-parser.c
index 7c19d78..b890c6c 100644
--- a/src/common/config-parser.c
+++ b/src/common/config-parser.c
@@ -21,12 +21,10 @@ typedef enum {
CONFIG_SECTION_KEY,
CONFIG_SECTION_VALUE_START,
CONFIG_SECTION_VALUE_QUOTE,
- CONFIG_SECTION_VALUE_SQUOTE,
CONFIG_SECTION_VALUE_POST_QUOTED,
CONFIG_SECTION_VALUE,
CONFIG_SECTION_LIST_START,
CONFIG_SECTION_LIST_QUOTE,
- CONFIG_SECTION_LIST_SQUOTE,
CONFIG_SECTION_LIST_POST_QUOTED,
CONFIG_SECTION_LIST,
} bc_configparser_state_t;
@@ -199,10 +197,6 @@ bc_config_parse(const char *src, size_t src_len, const char *list_sections[],
state = CONFIG_SECTION_VALUE_QUOTE;
break;
}
- if (c == '\'') {
- state = CONFIG_SECTION_VALUE_SQUOTE;
- break;
- }
bc_string_append_c(value, c);
state = CONFIG_SECTION_VALUE;
break;
@@ -220,19 +214,6 @@ bc_config_parse(const char *src, size_t src_len, const char *list_sections[],
bc_string_append_c(value, c);
break;
- case CONFIG_SECTION_VALUE_SQUOTE:
- if (c == '\'') {
- bc_trie_insert(section->data, bc_str_strip(key),
- bc_string_free(value, false));
- free(key);
- key = NULL;
- value = NULL;
- state = CONFIG_SECTION_VALUE_POST_QUOTED;
- break;
- }
- bc_string_append_c(value, c);
- break;
-
case CONFIG_SECTION_VALUE_POST_QUOTED:
if (c == ' ' || c == '\t' || c == '\f' || c == '\v')
break;
@@ -268,10 +249,6 @@ bc_config_parse(const char *src, size_t src_len, const char *list_sections[],
state = CONFIG_SECTION_LIST_QUOTE;
break;
}
- if (c == '\'') {
- state = CONFIG_SECTION_LIST_SQUOTE;
- break;
- }
bc_string_append_c(value, c);
state = CONFIG_SECTION_LIST;
break;
@@ -288,18 +265,6 @@ bc_config_parse(const char *src, size_t src_len, const char *list_sections[],
bc_string_append_c(value, c);
break;
- case CONFIG_SECTION_LIST_SQUOTE:
- if (c == '\'') {
- section->data = bc_slist_append(section->data,
- bc_string_free(value, false));
- value = NULL;
- state = CONFIG_SECTION_LIST_POST_QUOTED;
- break;
-
- }
- bc_string_append_c(value, c);
- break;
-
case CONFIG_SECTION_LIST_POST_QUOTED:
if (c == ' ' || c == '\t' || c == '\f' || c == '\v')
break;