Closed llbit closed 6 years ago
OK, that's interesting. I think the proper way to fix this is to change the escape-fname-regex to handle the separator. I'll look at it and see what I can find.
OK, on line 355 of Makefile.in, we have this:
escape-fname-regex = $(subst /,\\/,$(subst .,\\.,$1))
So it looks like it's at least trying to escape the forward slash character, as well as dots. What I find curious about this is the fact that it seems to work with one backslash, but not two. Can you try just changing the subst command in escape-fname-regex to have a single backslash (instead of replacing it with your subst call) and report your findings?
I changed the regex to the following and it seems to remove the sed error:
diff --git a/Makefile b/Makefile
index f5810ee..cf9d7ca 100644
--- a/Makefile
+++ b/Makefile
@@ -1001,7 +1001,7 @@ cleanse-filename = $(subst .,_,$(subst /,__,$1))
# Escape dots and forward slashes.
# $(call escape-fname-regex,str)
-escape-fname-regex = $(subst /,\\/,$(subst .,\\.,$1))
+escape-fname-regex = $(subst /,\/,$(subst .,\\.,$1))
# Test that a file exists
# $(call test-exists,file)
I'm using GNU sed 4.2.2 on Ubuntu 16.04.3 LTS.
OK, excellent. Sorry for the delay. I'm pushing a new version to head that has this change in it.
I think commit 6e3a363a2c616720b8f051a716293ccbd376ad9b fixes this.
I noticed that I got messages from sed while building a large document. I narrowed it down and found that it was caused by using a subdirectory. I made a minimal reproducible example for the error here: https://github.com/llbit/Multi-PDF
The error message I get is:
By using
SHELL_DEBUG=1
I saw the following:It seems like the sed command might not be properly escaped.
I made the following changes in the Makefile to remove the sed error: