From 9861debd8ea5adacec8aed547fbcbb91a96e7028 Mon Sep 17 00:00:00 2001 From: nishi Date: Wed, 19 Jun 2024 01:13:15 +0000 Subject: [PATCH] fix stuff git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@359 d4a5a174-5a4a-5b4b-b672-37683c10d7d5 --- Library/parser.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Library/parser.c b/Library/parser.c index 4aca253..44ef2bb 100644 --- a/Library/parser.c +++ b/Library/parser.c @@ -110,9 +110,13 @@ bool __dw_print_node(struct Node* node, bool top) { printf("\""); fflush(stdout); int i; - for(i = 0; node->string[i] != 0; i++){ - if(node->string[i] == '"') printf("\\"); - printf("%c", node->string[i]); + for(i = 0; node->string[i] != 0; i++) { + if(node->string[i] >= 0 && node->string[i] <= 0x1f) { + printf("\\x%02x", node->string[i]); + } else { + if(node->string[i] == '"') printf("\\"); + printf("%c", node->string[i]); + } fflush(stdout); } printf("\""); -- 2.43.0