diff options
-rw-r--r-- | src/cli_new.c | 17 | ||||
-rw-r--r-- | src/set.c | 11 |
2 files changed, 17 insertions, 11 deletions
diff --git a/src/cli_new.c b/src/cli_new.c index b5d7add..5fdf60b 100644 --- a/src/cli_new.c +++ b/src/cli_new.c @@ -2039,6 +2039,23 @@ boolean validate_value(vtw_def *def, char *cp) int status; boolean ret=TRUE; + /* certain characters are not allowed */ + { + int i = 0; + for (i = 0; i < strlen(cp); i++) { + if (cp[i] == '\'') { + fprintf(out_stream, "Cannot use the \"'\" (single quote) character " + "in a value string\n"); + bye("single quote in value string\n"); + } + if (cp[i] == '\n') { + fprintf(out_stream, "Cannot use the newline character " + "in a value string\n"); + bye("newline in value string\n"); + } + } + } + /* prepare cur_value */ set_at_string(cp); status = char2val(def, cp, &validate_value_val); @@ -29,17 +29,6 @@ boolean set_validate(vtw_def *defp, char *valp, boolean empty_val) char* path_end=NULL; if (!empty_val) { - int i = 0; - int val_len = strlen(valp); - - for (i = 0; i < val_len; i++) { - if (valp[i] == '\'') { - fprintf(out_stream, "Cannot use the \"'\" (single quote) character " - "in a value string\n"); - bye("single quote in value string\n"); - } - } - { clind_path_ref tp = clind_path_construct(t_path.path); if(tp) { |