From 6cd4c734387a8c6e12a2948d1471140f1099e203 Mon Sep 17 00:00:00 2001 From: kamkow1 Date: Sat, 20 Sep 2025 11:13:48 +0200 Subject: [PATCH] tb Allow for only one consequent alias expansion --- base/scripts/rc.tb | 1 + user/tb/runtime.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/base/scripts/rc.tb b/base/scripts/rc.tb index 74e6f70..ea26b4c 100644 --- a/base/scripts/rc.tb +++ b/base/scripts/rc.tb @@ -1 +1,2 @@ @mkalias pctl base:/bin/pctl +@mkalias tb base:/bin/tb diff --git a/user/tb/runtime.c b/user/tb/runtime.c index 3903a82..94d636c 100644 --- a/user/tb/runtime.c +++ b/user/tb/runtime.c @@ -36,9 +36,8 @@ bool rt_mkalias(Token *tks) { while (tk) { if (i == 0) { usprintf(alias->namebuf, "%.*s", (int)tk->len, tk->ptr); - } else { - size_t off = string_len(alias->valbuf); - usprintf(alias->valbuf + off, "%.*s", (int)tk->len, tk->ptr); + } else if (i == 1) { + usprintf(alias->valbuf, "%.*s", (int)tk->len, tk->ptr); } i++; tk = tk->next;