|
@@ -522,7 +522,10 @@ static enum event_type __read_token(char **tok)
|
|
last_ch = ch;
|
|
last_ch = ch;
|
|
ch = __read_char();
|
|
ch = __read_char();
|
|
buf[i++] = ch;
|
|
buf[i++] = ch;
|
|
- } while (ch != quote_ch && last_ch != '\\');
|
|
|
|
|
|
+ /* the '\' '\' will cancel itself */
|
|
|
|
+ if (ch == '\\' && last_ch == '\\')
|
|
|
|
+ last_ch = 0;
|
|
|
|
+ } while (ch != quote_ch || last_ch == '\\');
|
|
/* remove the last quote */
|
|
/* remove the last quote */
|
|
i--;
|
|
i--;
|
|
goto out;
|
|
goto out;
|
|
@@ -2325,7 +2328,27 @@ static void pretty_print(void *data, int size, struct event *event)
|
|
|
|
|
|
for (; *ptr; ptr++) {
|
|
for (; *ptr; ptr++) {
|
|
ls = 0;
|
|
ls = 0;
|
|
- if (*ptr == '%') {
|
|
|
|
|
|
+ if (*ptr == '\\') {
|
|
|
|
+ ptr++;
|
|
|
|
+ switch (*ptr) {
|
|
|
|
+ case 'n':
|
|
|
|
+ printf("\n");
|
|
|
|
+ break;
|
|
|
|
+ case 't':
|
|
|
|
+ printf("\t");
|
|
|
|
+ break;
|
|
|
|
+ case 'r':
|
|
|
|
+ printf("\r");
|
|
|
|
+ break;
|
|
|
|
+ case '\\':
|
|
|
|
+ printf("\\");
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ printf("%c", *ptr);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else if (*ptr == '%') {
|
|
saveptr = ptr;
|
|
saveptr = ptr;
|
|
show_func = 0;
|
|
show_func = 0;
|
|
cont_process:
|
|
cont_process:
|