From 427f4120f77d55ca04ac559747651469e3e86260 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Sat, 9 Apr 2022 17:17:33 -0400 Subject: Fix bug with character literals --- src/texec/eval.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/texec/eval.go b/src/texec/eval.go index 33f838e..510805e 100644 --- a/src/texec/eval.go +++ b/src/texec/eval.go @@ -374,7 +374,7 @@ func getStringLiteral(v tparse.Node) []interface{} { } func getCharLiteral(v tparse.Node) byte { - val, mb, _, err := strconv.UnquoteChar(v.Data.Data, byte('\'')) + val, mb, _, err := strconv.UnquoteChar(v.Data.Data[1:], byte('\'')) if err != nil || mb == true{ errOut(fmt.Sprintf("Failed to parse character as single byte. %v", v.Data)) -- cgit v1.2.3