chiark
/
gitweb
/
~ian
/
hippotat.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
09af572
)
config: bail on same quote in quotes, break out quote var
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 8 Aug 2021 01:47:40 +0000
(
02:47
+0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 8 Aug 2021 01:48:47 +0000
(
02:48
+0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/config.rs
patch
|
blob
|
history
diff --git
a/src/config.rs
b/src/config.rs
index d899348ee59afc791cbf553f0ad0a14495f33907..b439e4af1c56f32151dfffa40024f124b93f385a 100644
(file)
--- a/
src/config.rs
+++ b/
src/config.rs
@@
-281,12
+281,14
@@
impl Aggregate {
anyhow!("quoted value contains backslash, not supported")
);
}
- let unq = raw[1..].strip_suffix(&raw[0..1])
+ let quote = &raw[0..1];
+
+ let unq = raw[1..].strip_suffix(quote)
.ok_or_else(
|| anyhow!("mismatched quotes around quoted value")
)?
.to_owned();
- if unq.contains(
&raw[0..1]
) {
+ if unq.contains(
quote
) {
throw!(anyhow!(
"quoted value contains quote (escaping not supported)"
))