xC: make alias creation tolerant to prefixed names

Those would not work, so skip the first forward slash.

Note that liberty can save arbitrary alias names since 6e93119,
making the removed comment about checking outdated.
This commit is contained in:
Přemysl Eric Janouch 2022-08-29 15:18:27 +02:00
parent b454920c81
commit 3af1765261
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 2 additions and 1 deletions

3
xC.c
View File

@ -11547,10 +11547,11 @@ handle_command_alias (struct handler_args *a)
if (!*a->arguments)
return show_aliases_list (a->ctx);
// TODO: validate the name; maybe also while loading configuration
char *name = cut_word (&a->arguments);
if (!*a->arguments)
return false;
if (*name == '/')
name++;
struct config_item *alias = config_item_string_from_cstr (a->arguments);