[Bug binutils/26865] windres: --preprocessor option won't respect space in file path

2021-06-22 Thread eliz at gnu dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=26865

--- Comment #17 from Eli Zaretskii  ---
(In reply to Nick Clifton from comment #16)
> (In reply to Eli Zaretskii from comment #15)
>  
> > Nick, should I just revert the erroneous revert in `quot`?
> 
> No.  There has been no consensus that the change is correct, so I am going
> to leave things as they are.

The lack of consensus was about quoting the argument of --preprocessor, and
that doesn't use `quot` at all.  `quot` is used in quoting the argument of
--preprocessor-arg and of -D and -U, which are different command-line switches,
not the one which caused the breakage and was the (mistaken) cause of the
revert.

Or what am I missing?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/26865] windres: --preprocessor option won't respect space in file path

2021-06-22 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26865

--- Comment #16 from Nick Clifton  ---
(In reply to Eli Zaretskii from comment #15)

> Nick, should I just revert the erroneous revert in `quot`?

No.  There has been no consensus that the change is correct, so I am going to
leave things as they are.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/26865] windres: --preprocessor option won't respect space in file path

2021-06-19 Thread eliz at gnu dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=26865

--- Comment #15 from Eli Zaretskii  ---
(In reply to Eli Zaretskii from comment #14)
> (In reply to Nick Clifton from comment #13)
> > Hi Guys,
> > 
> >   How about a compromise ?  Instead of changing the behaviour of
> > --preprocessor
> >   and --preprocessor-arg, I could add two new options --quoted-preprocessor
> > and 
> >   --quoted-preprocessor-arg.  (Abbreviated to -qp and -qpa).  These new
> > options
> >   would unconditionally surround their arguments in double quotes.  Would
> > that
> >   work for everyone ?
> 
> I think only --quoted-preprocessor-arg is needed, because everyone agreed
> the way --preprocessor worked before the last revert is correct and doesn't
> affect the issue in PR 27594.  So if you don't mind, I'd like to reinstate
> the changes in `quot` which were mistakenly reverted.

Ping!

Nick, should I just revert the erroneous revert in `quot`?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/26865] windres: --preprocessor option won't respect space in file path

2021-05-25 Thread eliz at gnu dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=26865

--- Comment #14 from Eli Zaretskii  ---
(In reply to Nick Clifton from comment #13)
> Hi Guys,
> 
>   How about a compromise ?  Instead of changing the behaviour of
> --preprocessor
>   and --preprocessor-arg, I could add two new options --quoted-preprocessor
> and 
>   --quoted-preprocessor-arg.  (Abbreviated to -qp and -qpa).  These new
> options
>   would unconditionally surround their arguments in double quotes.  Would
> that
>   work for everyone ?

I think only --quoted-preprocessor-arg is needed, because everyone agreed the
way --preprocessor worked before the last revert is correct and doesn't affect
the issue in PR 27594.  So if you don't mind, I'd like to reinstate the changes
in `quot` which were mistakenly reverted.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/26865] windres: --preprocessor option won't respect space in file path

2021-05-25 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26865

Nick Clifton  changed:

   What|Removed |Added

 Resolution|FIXED   |---
 Status|RESOLVED|REOPENED

--- Comment #13 from Nick Clifton  ---
Hi Guys,

  How about a compromise ?  Instead of changing the behaviour of --preprocessor
  and --preprocessor-arg, I could add two new options --quoted-preprocessor and 
  --quoted-preprocessor-arg.  (Abbreviated to -qp and -qpa).  These new options
  would unconditionally surround their arguments in double quotes.  Would that
  work for everyone ?

Cheers
  Nick

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/26865] windres: --preprocessor option won't respect space in file path

2021-05-15 Thread eliz at gnu dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=26865

Eli Zaretskii  changed:

   What|Removed |Added

 CC||eliz at gnu dot org

--- Comment #12 from Eli Zaretskii  ---
(In reply to cvs-com...@gcc.gnu.org from comment #11)
> The master branch has been updated by Nick Clifton :
> 
> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;
> h=749c700282097cf679ff019a9674d7c762f48619
> 
> commit 749c700282097cf679ff019a9674d7c762f48619
> Author: Thomas Wolff 
> Date:   Mon May 10 11:28:15 2021 +0100
> 
> Restore old behaviour of windres so that options containing spaces are
> not enclosed in double quotes.
> 
> PR 4356
> PR 26865
> PR 27594
> * windres.c (quot): Revert previous delta.  Do not use double
> quotes when spaces are detected in options.
> * doc/binutils.texi (windres): Remove suggestion that the
> --preprocessor option can take arguments.

So, given the discussion in PR 27594, are there any objections to reverting the
`quot` part of commit 749c700, thus reinstating the changes in commit cc3edc5? 
If there are no objections, I'd like to go back to the correct quoting in
`quot` on Windows.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/26865] windres: --preprocessor option won't respect space in file path

2021-05-10 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=26865

--- Comment #11 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Nick Clifton :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=749c700282097cf679ff019a9674d7c762f48619

commit 749c700282097cf679ff019a9674d7c762f48619
Author: Thomas Wolff 
Date:   Mon May 10 11:28:15 2021 +0100

Restore old behaviour of windres so that options containing spaces are not
enclosed in double quotes.

PR 4356
PR 26865
PR 27594
* windres.c (quot): Revert previous delta.  Do not use double
quotes when spaces are detected in options.
* doc/binutils.texi (windres): Remove suggestion that the
--preprocessor option can take arguments.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/26865] windres: --preprocessor option won't respect space in file path

2020-11-27 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26865

Nick Clifton  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #10 from Nick Clifton  ---
Phew!

Patch applied.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/26865] windres: --preprocessor option won't respect space in file path

2020-11-27 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=26865

--- Comment #9 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Nick Clifton :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=21c33bcbe36377abf01614fb1b9be439a3b6de20

commit 21c33bcbe36377abf01614fb1b9be439a3b6de20
Author: Nick Clifton 
Date:   Fri Nov 27 14:18:20 2020 +

Allow spaces in the name of the external preprocessor used by windres.

PR 26865
* windres.c (main): If the preprocessor name includes spaces,
ensure that it is quoted.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/26865] windres: --preprocessor option won't respect space in file path

2020-11-27 Thread katayama.hirofumi.mz at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26865

--- Comment #8 from katayama.hirofumi.mz at gmail dot com ---
Sorry, my envirnment was broken.

Now your patch works. OK.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/26865] windres: --preprocessor option won't respect space in file path

2020-11-27 Thread katayama.hirofumi.mz at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26865

--- Comment #7 from katayama.hirofumi.mz at gmail dot com ---
$ ./windres.exe b.rc  -o b_res.o && echo "OK"

Also doesn't work.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/26865] windres: --preprocessor option won't respect space in file path

2020-11-27 Thread katayama.hirofumi.mz at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26865

--- Comment #6 from katayama.hirofumi.mz at gmail dot com ---
It causes abnormal termination.

$ ./windres.exe "--preprocessor=/mingw32/bin/c pp.exe" a.rc  -o a_res.o && echo
"OK"

$

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/26865] windres: --preprocessor option won't respect space in file path

2020-11-27 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26865

Nick Clifton  changed:

   What|Removed |Added

  Attachment #12999|0   |1
is obsolete||

--- Comment #5 from Nick Clifton  ---
Created attachment 13002
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13002=edit
Proposed patch

Well that was embarrassing.  I really should test my patches before posting
them.

So - here is a better patch for you to try.  This one definitely compiles, but
I have not actually tested it myself as I do not have a mingw test environment.

Please let me know if this one works. :-)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/26865] windres: --preprocessor option won't respect space in file path

2020-11-26 Thread katayama.hirofumi.mz at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26865

--- Comment #4 from katayama.hirofumi.mz at gmail dot com ---
Reproduction steps:

$ which cpp
/mingw32/bin/cpp

$ cp /mingw32/bin/cpp "/mingw32/bin/cpp .exe"

$ windres "--preprocessor=/mingw32/bin/cpp .exe" a.rc
cpp: error: .exe: No such file or directory
cpp: fatal error: no input files
compilation terminated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/26865] windres: --preprocessor option won't respect space in file path

2020-11-26 Thread katayama.hirofumi.mz at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26865

--- Comment #3 from katayama.hirofumi.mz at gmail dot com ---
Not fixed yet. Compilation error.

resrc.c: In function 'filename_need_quotes':
resrc.c:368:9: error: duplicate case value
  368 | case ' ':
  | ^~~~
resrc.c:363:9: note: previously used here
  363 | case ' ':

  switch (*filename)
{
case '&':
case ' ': // this
case '<':
case '>':
case '|':
case '%':
case ' ': // and this
  return 1;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/26865] windres: --preprocessor option won't respect space in file path

2020-11-26 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26865

Nick Clifton  changed:

   What|Removed |Added

   Assignee|unassigned at sourceware dot org   |nickc at redhat dot com
   Last reconfirmed||2020-11-26
 CC||nickc at redhat dot com
 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED

--- Comment #1 from Nick Clifton  ---
Hi Katayama,

  Please could you try out the uploaded patch and let me know if it works.

  It turns out that there is already a mechanism for quoting the filename,
  (see how the fnquotes variable is initialised), but it was not allowing
  for filenames that contain spaces.  The patch tries to fix this.

Cheers
  Nick

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/26865] windres: --preprocessor option won't respect space in file path

2020-11-26 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26865

--- Comment #2 from Nick Clifton  ---
Created attachment 12999
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12999=edit
Proposed patch

-- 
You are receiving this mail because:
You are on the CC list for the bug.