public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Yvan Roux <yvan.roux@foss.st.com>
To: <binutils@sourceware.org>
Subject: [PATCH] _bfd_real_fopen should not use ccs parameter on Windows
Date: Tue, 3 May 2022 14:39:59 +0200	[thread overview]
Message-ID: <20220503123959.GD28900@gnbcxd0114.gnb.st.com> (raw)

Hi,

As it was discussed in https://sourceware.org/bugzilla/show_bug.cgi?id=25713
according to MSDN, the ccs=UNICODE should only be used when the encoding of the
file stream is supposed to be UTF-8 or UTF-16LE, and is not related to the
encoding of the file name.

Regression tested without any issue.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@st.com>
Signed-off-by: Yvan ROUX <yvan.roux@foss.st.com>
---
 bfd/bfdio.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/bfd/bfdio.c b/bfd/bfdio.c
index 5c9a6555894..dc8d3916509 100644
--- a/bfd/bfdio.c
+++ b/bfd/bfdio.c
@@ -119,7 +119,6 @@ _bfd_real_fopen (const char *filename, const char *modes)
   /* PR 25713: Handle extra long path names possibly containing '..' and '.'.  */
    wchar_t **     lpFilePart = {NULL};
    const wchar_t  prefix[] = L"\\\\?\\";
-   const wchar_t  ccs[] = L", ccs=UNICODE";
    const size_t   partPathLen = strlen (filename) + 1;
 
    /* Converting the partial path from ascii to unicode.
@@ -151,10 +150,9 @@ _bfd_real_fopen (const char *filename, const char *modes)
    free (partPath);
 
    /* It is non-standard for modes to exceed 16 characters.  */
-   wchar_t    modesW[16 + sizeof(ccs)];
+   wchar_t    modesW[16];
 
    MultiByteToWideChar (CP_UTF8, 0, modes, -1, modesW, sizeof(modesW));
-   wcscat (modesW, ccs);
 
    FILE *     file = _wfopen (fullPath, modesW);
    free (fullPath);
-- 
2.17.1




             reply	other threads:[~2022-05-03 12:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-03 12:39 Yvan Roux [this message]
2022-05-17 14:33 ` Yvan Roux
2022-05-19  9:59   ` Nick Clifton
2022-05-20  6:54     ` Yvan Roux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220503123959.GD28900@gnbcxd0114.gnb.st.com \
    --to=yvan.roux@foss.st.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).