Fixed handling of "echo."
This commit is contained in:
parent
838a1ea09d
commit
8d02010ff7
|
@ -212,16 +212,18 @@ void WCMD_echo (const char *command) {
|
||||||
static const char *eon = "Echo is ON\n", *eoff = "Echo is OFF\n";
|
static const char *eon = "Echo is ON\n", *eoff = "Echo is OFF\n";
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
|
if ((command[0] == '.') && (command[1] == 0)) {
|
||||||
|
WCMD_output (newline);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (command[0]==' ')
|
||||||
|
command++;
|
||||||
count = strlen(command);
|
count = strlen(command);
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
if (echo_mode) WCMD_output (eon);
|
if (echo_mode) WCMD_output (eon);
|
||||||
else WCMD_output (eoff);
|
else WCMD_output (eoff);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((count == 1) && (command[0] == '.')) {
|
|
||||||
WCMD_output (newline);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (lstrcmpi(command, "ON") == 0) {
|
if (lstrcmpi(command, "ON") == 0) {
|
||||||
echo_mode = 1;
|
echo_mode = 1;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -384,12 +384,7 @@ void WCMD_process_command (char *command)
|
||||||
WCMD_directory ();
|
WCMD_directory ();
|
||||||
break;
|
break;
|
||||||
case WCMD_ECHO:
|
case WCMD_ECHO:
|
||||||
/* Use the unstripped version of the following data - step over the space */
|
WCMD_echo(&whichcmd[count]);
|
||||||
/* but only if a parameter follows */
|
|
||||||
if (strlen(&whichcmd[count]) > 0)
|
|
||||||
WCMD_echo(&whichcmd[count+1]);
|
|
||||||
else
|
|
||||||
WCMD_echo(&whichcmd[count]);
|
|
||||||
break;
|
break;
|
||||||
case WCMD_FOR:
|
case WCMD_FOR:
|
||||||
WCMD_for (p);
|
WCMD_for (p);
|
||||||
|
|
Loading…
Reference in New Issue