[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

Re: [XaraXtreme-dev] Resources with spaces in the file names


Luke Hart wrote:
Will this patch modify the resource script so that it doesn't choke on filenames with spaces? I need to change the filename of the defautl template to '800 by 600 drawing.xar' to replicate the template menu in Camelot.

Um it looks right as far as it goes, but I don't think it will be
sufficient (i.e. there will be other places that might fail).
For instance, xrc.d is parsed later to get a list of files,
and that parsing is done on whitespace breaks, and escaped spaces
won't be handled rights. See the definition of XRCSTRINGS
XRCDIALOGS etc.; it's possible it might work for files that
are not strings, dialogs etc.

Given UNIX is notoriously bad about filenames with spaces in,
couldn't we either just call it '800-by-600-drawing.xar' which
will work now (!), or use some resource mangling to print a
string on the menu which is different from the filename? We
already (presumably) get rid of ".xar".

If you do want to fix it, beware we will need to change
"buildresources.sh" too which currently builds the resources
for the Mac build in the same way. Note that I was thinking
of replacing the whole of the custom wxOil/Makefile.am stuff
with a single call to "buildresources" in the root Makefile
for Linux - i.e. do it the same as we do on the Mac. That's
more predictable, quicker, and doesn't suffer from some
race-condition I can't find with "make -j10". What would
you think to that?

I was also planning to rewrite the lot in perl (rather than
a shell script which calls perl 10 times) which would
(properly) solve the "spaces in filenames" issue. If
you were happy with that, a quick "space to hyphen"
swap might be all we need for 0.5.