From 1c1b8a22609081b176f1f6cd46f40a971e92fde5 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Mon, 8 Sep 2025 01:11:22 +0200 Subject: [PATCH] [NETSH] Print proper prompt --- base/applications/network/netsh/interpreter.c | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/base/applications/network/netsh/interpreter.c b/base/applications/network/netsh/interpreter.c index 4561c29e2d3..336d12e9869 100644 --- a/base/applications/network/netsh/interpreter.c +++ b/base/applications/network/netsh/interpreter.c @@ -220,6 +220,23 @@ InterpretScript( } +VOID +PrintPrompt( + PCONTEXT_ENTRY pContext) +{ + if (pContext == pRootContext) + { + ConPuts(StdOut, L"netsh"); + } + else + { + PrintPrompt(pContext->pParentContext); + ConPuts(StdOut, L" "); + ConPuts(StdOut, pContext->pszContextName); + } +} + + VOID InterpretInteractive(VOID) { @@ -236,12 +253,7 @@ InterpretInteractive(VOID) memset(args_vector, 0, sizeof(args_vector)); /* Shown just before the input where the user places commands */ - ConPuts(StdOut, L"netsh"); - if (pCurrentContext != pRootContext) - { - ConPuts(StdOut, L" "); - ConPuts(StdOut, pCurrentContext->pszContextName); - } + PrintPrompt(pCurrentContext); ConPuts(StdOut, L">"); /* Get input from the user. */