Skip to content

Commit 1c1b8a2

Browse files
committed
[NETSH] Print proper prompt
1 parent 5d5e5d1 commit 1c1b8a2

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

base/applications/network/netsh/interpreter.c

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,23 @@ InterpretScript(
220220
}
221221

222222

223+
VOID
224+
PrintPrompt(
225+
PCONTEXT_ENTRY pContext)
226+
{
227+
if (pContext == pRootContext)
228+
{
229+
ConPuts(StdOut, L"netsh");
230+
}
231+
else
232+
{
233+
PrintPrompt(pContext->pParentContext);
234+
ConPuts(StdOut, L" ");
235+
ConPuts(StdOut, pContext->pszContextName);
236+
}
237+
}
238+
239+
223240
VOID
224241
InterpretInteractive(VOID)
225242
{
@@ -236,12 +253,7 @@ InterpretInteractive(VOID)
236253
memset(args_vector, 0, sizeof(args_vector));
237254

238255
/* Shown just before the input where the user places commands */
239-
ConPuts(StdOut, L"netsh");
240-
if (pCurrentContext != pRootContext)
241-
{
242-
ConPuts(StdOut, L" ");
243-
ConPuts(StdOut, pCurrentContext->pszContextName);
244-
}
256+
PrintPrompt(pCurrentContext);
245257
ConPuts(StdOut, L">");
246258

247259
/* Get input from the user. */

0 commit comments

Comments
 (0)