--- libaitcli/src/cli.c 2022/12/05 22:23:38 1.12 +++ libaitcli/src/cli.c 2025/12/17 23:30:11 1.13 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: cli.c,v 1.12 2022/12/05 22:23:38 misho Exp $ +* $Id: cli.c,v 1.13 2025/12/17 23:30:11 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004 - 2022 +Copyright 2004 - 2025 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -168,11 +168,14 @@ cli_Cmd_End(void * __restrict cli_buffer, int idx, cha if (!idx) return cli_Cmd_Exit(cli_buffer, idx, args); - buf->line_level--; - snprintf(szPrompt, sizeof szPrompt, "%s{%d}> ", buf->line_porigin, buf->line_level); - cli_setPrompt(buf, szPrompt); - cli_Printf(buf, "Enter to config level %d\n", buf->line_level); - return RETCODE_OK; + if (buf->line_level) { + buf->line_level--; + snprintf(szPrompt, sizeof szPrompt, "%s{%d}> ", buf->line_porigin, buf->line_level); + cli_setPrompt(buf, szPrompt); + cli_Printf(buf, "Enter to config level %d\n", buf->line_level); + return RETCODE_OK; + } else + return RETCODE_EOF; } /*