From: Michael Wallner Date: Fri, 7 Jul 2017 07:23:17 +0000 (+0200) Subject: cpp: fix dumping strings and chars X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=503860f8936b47b2d4e356d815c112c60d91a95a;p=m6w6%2Fext-psi cpp: fix dumping strings and chars --- diff --git a/src/types/cpp_macro_decl.c b/src/types/cpp_macro_decl.c index 42ed0f4..e540131 100644 --- a/src/types/cpp_macro_decl.c +++ b/src/types/cpp_macro_decl.c @@ -83,7 +83,16 @@ void psi_cpp_macro_decl_dump(int fd, struct psi_cpp_macro_decl *macro) struct psi_token *tok; while (psi_plist_get(macro->tokens, i++, &tok)) { - dprintf(fd, " %s", tok->text); + switch (tok->type) { + case PSI_T_QUOTED_STRING: + dprintf(fd, " \"%s\"", tok->text); + break; + case PSI_T_QUOTED_CHAR: + dprintf(fd, " '%s'", tok->text); + break; + default: + dprintf(fd, " %s", tok->text); + } } } }