Fixed invalid assertion in error()

This commit is contained in:
goldsimon 2010-03-26 14:44:20 +00:00
parent e4ad203b0b
commit 64763950ca

View File

@ -1354,7 +1354,7 @@ parse_command(struct command *com, u32_t len)
} }
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
static void static void
error(s8_t err, struct netconn *conn) shell_error(s8_t err, struct netconn *conn)
{ {
switch (err) { switch (err) {
case ESYNTAX: case ESYNTAX:
@ -1366,6 +1366,9 @@ error(s8_t err, struct netconn *conn)
case ETOOMANY: case ETOOMANY:
sendstr("## Too many arguments to command given"NEWLINE, conn); sendstr("## Too many arguments to command given"NEWLINE, conn);
break; break;
case ECLOSED:
sendstr("## Connection closed"NEWLINE, conn);
break;
default: default:
LWIP_ASSERT("Unknown error", 0); LWIP_ASSERT("Unknown error", 0);
break; break;
@ -1415,14 +1418,14 @@ shell_main(struct netconn *conn)
com.conn = conn; com.conn = conn;
err = com.exec(&com); err = com.exec(&com);
} }
if (err != ESUCCESS) {
error(err, conn);
}
if (err == ECLOSED) { if (err == ECLOSED) {
printf("Closed"NEWLINE); printf("Closed"NEWLINE);
error(err, conn); shell_error(err, conn);
goto close; goto close;
} }
if (err != ESUCCESS) {
shell_error(err, conn);
}
} else { } else {
sendstr(NEWLINE NEWLINE sendstr(NEWLINE NEWLINE
"lwIP simple interactive shell."NEWLINE "lwIP simple interactive shell."NEWLINE