From: Ian Jackson Date: Sun, 8 Aug 2021 01:46:58 +0000 (+0100) Subject: config: bail on same quote in quotes X-Git-Tag: hippotat/1.0.0~228 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=09af57203e021dc02f5042b8978aa3a88e5f01b5;p=hippotat.git config: bail on same quote in quotes Signed-off-by: Ian Jackson --- diff --git a/src/config.rs b/src/config.rs index 3a45eb8..d899348 100644 --- a/src/config.rs +++ b/src/config.rs @@ -286,6 +286,12 @@ impl Aggregate { || anyhow!("mismatched quotes around quoted value") )? .to_owned(); + if unq.contains(&raw[0..1]) { + throw!(anyhow!( + "quoted value contains quote (escaping not supported)" + )) + } + Ok::<_,AE>(unq) })() .with_context(|| format!("key {:?}", key))