From 5522ddfbf59dec46c2725d63c350217361cc280c Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 17 Aug 2022 00:51:56 +0300 Subject: fix(tvix/eval): fix several string escapings These were missing an additional level of escaping, silly oversight caught by an upstream test. Change-Id: I0312084475e4b88c83945614e9aa5b34c6bc3ec2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6232 Reviewed-by: sterni Reviewed-by: grfn Tested-by: BuildkiteCI --- tvix/eval/src/value/string.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tvix') diff --git a/tvix/eval/src/value/string.rs b/tvix/eval/src/value/string.rs index 42d9366b95..f352281be3 100644 --- a/tvix/eval/src/value/string.rs +++ b/tvix/eval/src/value/string.rs @@ -92,9 +92,11 @@ impl NixString { fn nix_escape_char(ch: char) -> Option<&'static str> { match ch { - '\\' => Some("\\"), - '"' => Some("\\"), + '\\' => Some("\\\\"), + '"' => Some("\\\""), '\n' => Some("\\n"), + '\t' => Some("\\t"), + '\r' => Some("\\r"), _ => None, } } -- cgit 1.4.1