From e30e1fbb9cdba722d705da455890c1b805dd2576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Rigo?= Date: Fri, 25 Oct 2024 21:25:01 +0200 Subject: [PATCH] escape: comments --- src/escapeapp.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/escapeapp.rs b/src/escapeapp.rs index ad71c63..375efe0 100644 --- a/src/escapeapp.rs +++ b/src/escapeapp.rs @@ -14,6 +14,11 @@ enum EscType { } const SHELL_CHARS: &[u8; 4] = b"`$\"\\"; +// Note that bash is crazy regarding '!' +// echo "\!" will output \! +// ref: https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html +// > If enabled, history expansion will be performed unless an ‘!’ appearing in double quotes is +// > escaped using a backslash. The backslash preceding the ‘!’ is not removed. const BASH_CHARS: &[u8; 5] = b"`$\"\\!"; trait SliceEsc {