diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2022-08-29 15:18:27 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2022-08-29 15:22:11 +0200 |
commit | 3af1765261b7667b3570af8d69c2e1576a4b2d05 (patch) | |
tree | 8bb172c66f266ff9e6c317c89c5fb8ae17e68ed6 /xC.c | |
parent | b454920c81cdb33914b008b716f2d5db7144ba56 (diff) | |
download | xK-3af1765261b7667b3570af8d69c2e1576a4b2d05.tar.gz xK-3af1765261b7667b3570af8d69c2e1576a4b2d05.tar.xz xK-3af1765261b7667b3570af8d69c2e1576a4b2d05.zip |
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.
Diffstat (limited to 'xC.c')
-rw-r--r-- | xC.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); |