chiark / gitweb /
shapelib: magic: Actually substitute _colour in the template
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 14 May 2022 14:11:06 +0000 (15:11 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 14 May 2022 15:03:42 +0000 (16:03 +0100)
This doesn't actually work because _colour appears multiple times and
subst insists on it being there only once.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/shapelib.rs

index 84c25b8d6cb7304d47e60c4ba48b8b5a0df82f7b..4de0d671cb85f05701ff14c453c7e60cc6b2a66f 100644 (file)
@@ -1247,6 +1247,7 @@ fn process_files_entry(
         .replace_all(&magic.template, |caps: &regex::Captures| {
           format!("{}{}", caps.get(1).unwrap().as_str(), &image_table)
         });
+      let spec = c_colour(&spec)?;
 
       trace!("magic item {}\n\n{}\n", &item_name, &spec);