From 97b4ad4791f2a801744e1cef2231ac3a12a84eea Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 21 Jan 2024 23:24:30 +0800 Subject: [PATCH] Expand - Fix `stringify` a little --- src/expand/stringify.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/expand/stringify.cpp b/src/expand/stringify.cpp index 5905f742..a9ce3589 100644 --- a/src/expand/stringify.cpp +++ b/src/expand/stringify.cpp @@ -24,7 +24,20 @@ class CExpander: if(!rv.empty()) rv += " "; DEBUG(" += " << tok); - rv += tok.to_str(); + if( tok.type() == TOK_IDENT ) { + rv += tok.ident().name.c_str(); + } + else { + auto v = tok.to_str(); + const char* s = v.c_str(); + // Very hacky strip of hygine information (e.g. from paths) + if( s[0] == '{' ) { + while( *s != '}' ) + s ++; + s ++; + } + rv += s; + } } // TODO: Strip out any `{...}` sequences that aren't from nested