Bug 591 - windres: problem compiling resource containing & in filename
Summary: windres: problem compiling resource containing & in filename
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: unassigned
Depends on:
Reported: 2004-11-30 03:58 UTC by Marek Januszewski
Modified: 2007-06-06 08:05 UTC (History)
1 user (show)

See Also:
Host: i686-pc-cygwin
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Marek Januszewski 2004-11-30 03:58:58 UTC
I'm trying to compile a resource containg & in filename. how do I escape it? I
tried enclosing it in quotes and escaping it with \& and && - none of those work. 
the command line would be: 
windres -i 'proj&priv.rc' --input-format=rc -o 'proj&priv.rc' -O COFF 

and I'm getting: 

gcc: proj: No such file or directory 
gcc: warning: `-x c' after last input file has no effect 
gcc: no input files 
'priv.rc' is not recognized as an internal or external command, 
operable program or batch file. 
c:\Dev-Cpp\bin\windres.exe: no resources 

I tried escape chars \&, &&, enclosing in double quotes and none of it worked
Comment 1 Ian Lance Taylor 2004-11-30 04:16:27 UTC
The problem arises when windres invokes the preprocessor.  By default windres
just calls popen, and when the arguments include file names with special
characters like '&', the wrong thing happens.  The --use-temp-file option may
fix this.  Otherwise, you need to patch open_input_stream() in binutils/resrc.c
to do appropriate quoting.
Comment 2 Nick Clifton 2007-06-06 08:05:54 UTC
Hi Marek,

  This PR should now be resolved.  A patch to resrec.c has recently been checked
in which should ensure that filenames are properly quoted.