This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch][windres] Handle embedded spaces in input filenames


Danny Smith <dannysmith@clear.net.nz> writes:

> > -----Original Message-----
> > From: Christopher Faylor 
> >
> >>The problem is that these option args are passed to prepocessor
> without
> >>the enclosing quotes. Fixed like so:
> 
> > I can't check right now but is this because windres is using system to
> > call the preprocessor rather than calling fork/exec?  If so, wouldn't
> it
> > be better to just use execvp?
> 
> The preprocessor cmd string -- which is built by concat of the various
> windres args -- is run using pexecute. This, in turn, uses
> CreateProcess.

pexecute is supposed to handle all required quoting.  If your example
is indeed using pexecute, then the place to fix is
libiberty/pex-win32.c.

I see that there is a code path in resrc.c which does not use
pexecute.  In some cases open_input_stream will call popen.  That code
path should be changed to use pex_run and pex_read_output (which did
not exist when I wrote resrc.c).  Then the code should work without
requiring quoting in windres.c.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]