Skip to content
Snippets Groups Projects
Commit e6743f83 authored by Gregory Nutt's avatar Gregory Nutt
Browse files

CLE: Last bugfix commit was insufficient

parent f1fc9231
No related branches found
No related tags found
No related merge requests found
...@@ -824,45 +824,31 @@ static int cle_editloop(FAR struct cle_s *priv) ...@@ -824,45 +824,31 @@ static int cle_editloop(FAR struct cle_s *priv)
} }
break; break;
/* Newline terminates editing */ /* Newline terminates editing. But what is a newline? */
#if defined(CONFIG_EOL_IS_CR) #if defined(CONFIG_EOL_IS_CR) || defined(CONFIG_EOL_IS_EITHER_CRLF)
case '\r': /* CR terminates line */ case '\r': /* CR terminates line */
{
/* Add the newline character to the buffer */
cle_insertch(priv, '\n'); #elif defined(CONFIG_EOL_IS_LF) || defined(CONFIG_EOL_IS_BOTH_CRLF) || \
return OK; defined(CONFIG_EOL_IS_EITHER_CRLF)
}
break;
#elif defined(CONFIG_EOL_IS_BOTH_CRLF)
case '\r': /* Wait for the LF */
break;
#endif
#if defined(CONFIG_EOL_IS_LF) || defined(CONFIG_EOL_IS_BOTH_CRLF)
case '\n': /* LF terminates line */ case '\n': /* LF terminates line */
#endif
{ {
/* Add the newline character to the buffer */ /* Add the newline character to the buffer at the end of the line */
priv->curpos = priv->nchars;
cle_insertch(priv, '\n'); cle_insertch(priv, '\n');
cle_putch(priv, '\n');
return OK; return OK;
} }
break; break;
#endif
#ifdef CONFIG_EOL_IS_EITHER_CRLF
case '\r': /* Either CR or LF terminates line */
case '\n':
{
/* Add the newline character to the buffer */
cle_insertch(priv, '\n'); #if defined(CONFIG_EOL_IS_BOTH_CRLF)
return OK; case '\r': /* Wait for the LF */
}
break; break;
#endif #endif
/* Text to insert or unimplemented/invalid keypresses */ /* Text to insert or unimplemented/invalid keypresses */
default: default:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment