(nstr_resolve_id): Map identifier ~ to empty string. This makes
intuitive usage like fleet=~ and name=~ work.
This commit is contained in:
parent
0c1bd8e98b
commit
791d32a58a
1 changed files with 3 additions and 0 deletions
|
@ -408,6 +408,9 @@ nstr_resolve_id(struct valstr *val, struct castr *ca, int idx, int string_ok)
|
|||
/* interpret unresolvable identifier as string */
|
||||
val->val_type = NSC_STRING;
|
||||
val->val_cat = NSC_VAL;
|
||||
/* map identifier ~ to empty string, like some commands do */
|
||||
if (val->val_as.str.maxsz == 1 && val->val_as.str.base[0] == '~')
|
||||
val->val_as.str.maxsz = 0;
|
||||
return val;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue