> + (define (sanitize path-fragment) > + (escape-special-chars > + ;; GNU tar strips the leading slash off of absolute paths before applying > + ;; the transformations, so we need to do the same, or else our > + ;; replacements won't match any paths. > + (string-trim path-fragment #\/) > + ;; Escape the basic regexp special characters (see: "(sed) BRE syntax"). > + ;; We also need to escape "/" because we use it as a delimiter. > + "/*.^$[]\\" > + #\\)) I'm not such a fan of using blacklist. Those can easily get out of sync and nobody notices. But in this case I guess people take care not to extend basic regexp special characters in sed (tar) without the user specifying a flag requiring it. LGTM!