aaa-eps.eps contains the byte of 0x00 because an OTF font is embedded.
There is no problem.
aaa-main.ly uses \epsfile for including aaa-eps.ps.
So aaa-main.ps contains aaa-eps.eps.
LilyPond does not raise an error. But aaa-main.ps seems broken.
It cannot be converted to PDF and PNG.
aaa-main.ps is filled by 0x00 from the first 0x00 of embedded EPS until the end of EPS wrapper.
Of course, after the first 0x00 of aaa-eps.eps is not filled by 0x00.
In other words, again, aaa-main.ps seems broken.
If the EPS file does not contain the byte of 0x00, \epsfile can include it.
I investigated it, but I don't know the cause.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There are two files aaa-eps.ly and aaa-main.ly.
The following commands build an EPS file and a PS file.
$ lilypond -dbackend=eps --ps aaa-eps.ly $ lilypond --ps --pdf --png aaa-main.ly
aaa-eps.eps
contains the byte of 0x00 because an OTF font is embedded.There is no problem.
aaa-main.ly
uses \epsfile for includingaaa-eps.ps
.So
aaa-main.ps
containsaaa-eps.eps
.LilyPond does not raise an error. But
aaa-main.ps
seems broken.It cannot be converted to PDF and PNG.
aaa-main.ps
is filled by 0x00 from the first 0x00 of embedded EPS until the end of EPS wrapper.Of course, after the first 0x00 of
aaa-eps.eps
is not filled by 0x00.In other words, again,
aaa-main.ps
seems broken.If the EPS file does not contain the byte of 0x00, \epsfile can include it.
I investigated it, but I don't know the cause.
Fix ly:format for the string that contain zero
strcpy and strncpy cannot be used in std::string concatenation
because std::string may contain '\0' in its contents.
In order to avoid problems with string that contains '\0',
this commit replaces the strncpy to std::string::copy.
http://codereview.appspot.com/300930043
If I understand correctly, I've found the cause.
I've uploaded the patch.
Passes make, make check and a full make doc.
Patch on countdown for June 15th.
Patch counted down please push.
I've pushed to staging.
Issue 4890: Fix ly:format for the string that contain zero
commit 211634be6f90db700eb8e5725046b27aa153ee92