auto-sync
This commit is contained in:
parent
7f2144f940
commit
74f708ecf0
|
@ -153,6 +153,17 @@ static void echo(int 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) {
|
||||
if (line[0] == '"') {
|
||||
/**
|
||||
|
|
|
@ -132,7 +132,7 @@ int main(void) {
|
|||
testFLStack();
|
||||
|
||||
// resizeMap();
|
||||
printf("Success 20131009\r\n");
|
||||
printf("Success 20131012\r\n");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -284,6 +284,12 @@ void testConsoleLogic(void) {
|
|||
cmd = "\"h e\" ha";
|
||||
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);
|
||||
assertEquals(0, strcmp(UNKNOWN_COMMAND, ptr));
|
||||
|
|
Loading…
Reference in New Issue