(nstr_resolve_id): Map identifier ~ to empty string. This makes

intuitive usage like fleet=~ and name=~ work.
This commit is contained in:
Markus Armbruster 2006-05-28 07:37:24 +00:00
parent 0c1bd8e98b
commit 791d32a58a

View file

@ -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;
}