mirror of https://github.com/rusefi/rusefi.git
auto-sync
This commit is contained in:
parent
3e80f6a78a
commit
81542a4223
|
@ -153,6 +153,17 @@ static void echo(int value) {
|
||||||
print("got value: %d\r\n", value);
|
print("got value: %d\r\n", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *unquote(char *line) {
|
||||||
|
if (line[0] == '"') {
|
||||||
|
int len = strlen(line);
|
||||||
|
if (line[len - 1] == '"') {
|
||||||
|
line[len - 1] = 0;
|
||||||
|
return line + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return line;
|
||||||
|
}
|
||||||
|
|
||||||
int findEndOfToken(const char *line) {
|
int findEndOfToken(const char *line) {
|
||||||
if (line[0] == '"') {
|
if (line[0] == '"') {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -132,7 +132,7 @@ int main(void) {
|
||||||
testFLStack();
|
testFLStack();
|
||||||
|
|
||||||
// resizeMap();
|
// resizeMap();
|
||||||
printf("Success 20131009\r\n");
|
printf("Success 20131012\r\n");
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -284,6 +284,12 @@ void testConsoleLogic(void) {
|
||||||
cmd = "\"h e\" ha";
|
cmd = "\"h e\" ha";
|
||||||
assertEquals(5, findEndOfToken(cmd));
|
assertEquals(5, findEndOfToken(cmd));
|
||||||
|
|
||||||
|
strcpy(buffer, "echo");
|
||||||
|
assertTrue(strEqual("echo", unquote(buffer)));
|
||||||
|
|
||||||
|
strcpy(buffer, "\"echo\"");
|
||||||
|
assertTrueM("unquote quoted", strEqual("echo", unquote(buffer)));
|
||||||
|
|
||||||
|
|
||||||
char *ptr = validateSecureLine(UNKNOWN_COMMAND);
|
char *ptr = validateSecureLine(UNKNOWN_COMMAND);
|
||||||
assertEquals(0, strcmp(UNKNOWN_COMMAND, ptr));
|
assertEquals(0, strcmp(UNKNOWN_COMMAND, ptr));
|
||||||
|
|
Loading…
Reference in New Issue