PATCH 3/6: handle the Pound token in error message

Mikael Magnusson <[email protected]>
Newsgroups gmane.comp.shells.zsh.devel
Message-ID <[email protected]>
otherwise we print this:
parse error in ${...\M-D...} substitution

---

In practice, I'm not sure how to hit this path, I uncommented the
condition to test it, so maybe this is overly cautious for no gain?

 Src/subst.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Src/subst.c b/Src/subst.c
index 16a3cb055c..690d9344d9 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -3380,7 +3380,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags,
 		    if (haserr)
 			shtokenize(s);
 		} else if (haserr || errflag) {
-		    zerr("parse error in ${...%c...} substitution", s[-1]);
+		    zerr("parse error in ${...%c...} substitution", s[-1] == Pound ? '#' : s[-1]);
 		    return NULL;
 		}
 	    }
-- 
2.38.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.