From 42b5a5d150a9272cd208f3c6c252370cc2f7d955 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 13 Nov 2001 23:51:21 +0000 Subject: [PATCH] reformat the output of "alias" so that capturing it is useful for config scripts --- libs/util/cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/util/cmd.c b/libs/util/cmd.c index 85b901cee..04a42cd50 100644 --- a/libs/util/cmd.c +++ b/libs/util/cmd.c @@ -353,7 +353,7 @@ Cmd_Alias_f (void) if (Cmd_Argc () == 1) { Sys_Printf ("Current alias commands:\n"); for (alias = cmd_alias; alias; alias = alias->next) - Sys_Printf ("%s : %s\n", alias->name, alias->value); + Sys_Printf ("alias %s \"%s\"\n", alias->name, alias->value); return; } @@ -386,7 +386,6 @@ Cmd_Alias_f (void) if (i != c - 1) strcat (cmd, " "); } - strncat (cmd, "\n", sizeof (cmd) - strlen (cmd)); alias->value = cmd; } @@ -868,6 +867,7 @@ Cmd_ExecuteString (const char *text, cmd_source_t src) a = (cmdalias_t*)Hash_Find (cmd_alias_hash, cmd_argv[0]); if (a) { Cbuf_InsertText (a->value); + Cbuf_InsertText ("\n"); return; }