Skip to content

Commit 0540e4e

Browse files
Jeff Sennbnoordhuis
Jeff Senn
authored andcommittedJun 8, 2018
gyp: escape spaces in filenames in make generator
PR-URL: #1436 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 88fc6fa commit 0540e4e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎gyp/pylib/gyp/generator/make.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,9 @@ def Sourceify(path):
642642
def QuoteSpaces(s, quote=r'\ '):
643643
return s.replace(' ', quote)
644644

645+
def SourceifyAndQuoteSpaces(path):
646+
"""Convert a path to its source directory form and quote spaces."""
647+
return QuoteSpaces(Sourceify(path))
645648

646649
# TODO: Avoid code duplication with _ValidateSourcesForMSVSProject in msvs.py.
647650
def _ValidateSourcesForOSX(spec, all_sources):
@@ -1964,7 +1967,7 @@ def WriteAutoRegenerationRule(params, root_makefile, makefile_name,
19641967
"%(makefile_name)s: %(deps)s\n"
19651968
"\t$(call do_cmd,regen_makefile)\n\n" % {
19661969
'makefile_name': makefile_name,
1967-
'deps': ' '.join(map(Sourceify, build_files)),
1970+
'deps': ' '.join(map(SourceifyAndQuoteSpaces, build_files)),
19681971
'cmd': gyp.common.EncodePOSIXShellList(
19691972
[gyp_binary, '-fmake'] +
19701973
gyp.RegenerateFlags(options) +

0 commit comments

Comments
 (0)
Please sign in to comment.