Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nshlib/nsh_command.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ static const struct cmdmap_s g_cmdmap[] =
#endif

#if defined(CONFIG_BOARDCTL_SWITCH_BOOT) && !defined(CONFIG_NSH_DISABLE_SWITCHBOOT)
CMD_MAP("swtichboot", cmd_switchboot, 2, 2, "<image path>"),
CMD_MAP("switchboot", cmd_switchboot, 2, 2, "<image path>"),
#endif

#if !defined(CONFIG_NSH_DISABLESCRIPT) && !defined(CONFIG_NSH_DISABLE_TEST)
Expand Down
5 changes: 3 additions & 2 deletions nshlib/nsh_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,12 @@ int nsh_session(FAR struct console_stdio_s *pstate,

ret = cle_fd(pstate->cn_line, nsh_prompt(), LINE_MAX,
INFD(pstate), OUTFD(pstate));
if (ret < 0)
if (ret == EOF)
{
dprintf(ERRFD(pstate), g_fmtcmdfailed, "nsh_session",
"cle", NSH_ERRNO_OF(-ret));
continue;
ret = EXIT_SUCCESS;
break;
}
#else
/* Display the prompt string */
Expand Down
10 changes: 5 additions & 5 deletions system/cle/cle.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ static int cle_getch(FAR struct cle_s *priv)
if (nread == 0 || errcode != EINTR)
{
cledbg("ERROR: read from stdin failed: %d\n", errcode);
return -EIO;
return EOF;
}
}
}
Expand Down Expand Up @@ -372,13 +372,13 @@ static void cle_setcursor(FAR struct cle_s *priv, int16_t column)
int len;
int off;

/* Sub prompt offset from real postion to get correct offset to execute */
/* Sub prompt offset from real position to get correct offset to execute */

off = column - (priv->realpos - priv->coloffs);

cleinfo("column=%d offset=%d\n", column, off);

/* If cursor not move, retrun directly */
/* If cursor not move, return directly */

if (off == 0)
{
Expand Down Expand Up @@ -703,9 +703,9 @@ static int cle_editloop(FAR struct cle_s *priv)
for (; ; )
{
ch = cle_getch(priv);
if (ch < 0)
if (ch == EOF)
{
return -EIO;
return EOF;
}
else if (state != 0)
{
Expand Down
Loading