mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-25 05:15:41 +02:00
Trimming outer '"' when parsing the values.
This commit is contained in:
parent
4c4a20d835
commit
0d878e8b5c
2 changed files with 14 additions and 1 deletions
|
@ -231,6 +231,10 @@ For boolean tags, negation is done with a preceding '~':
|
|||
|
||||
~<tag>
|
||||
|
||||
To match for empty strings, use ' "" ':
|
||||
|
||||
<tag> == ""
|
||||
|
||||
In addition to explicit tag values, you can also specify a
|
||||
default/fallback particle.
|
||||
|
||||
|
|
|
@ -203,7 +203,16 @@ map_condition_from_str(const char *str)
|
|||
op_str[0] = '\0';
|
||||
|
||||
cond->tag = strdup(trim(tag));
|
||||
cond->value = value != NULL ? strdup(trim(value)) : NULL;
|
||||
|
||||
cond->value = NULL;
|
||||
if (value != NULL){
|
||||
value = trim(value);
|
||||
if (value[0] == '"' && value[strlen(value) - 1] == '"'){
|
||||
value[strlen(value) - 1] = '\0';
|
||||
++value;
|
||||
}
|
||||
cond->value = strdup(value);
|
||||
}
|
||||
|
||||
free(str_cpy);
|
||||
return cond;
|
||||
|
|
Loading…
Add table
Reference in a new issue