From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by sourceware.org (Postfix) with ESMTPS id A026E385737E for ; Tue, 3 May 2022 12:40:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A026E385737E Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2439Umre005468 for ; Tue, 3 May 2022 14:40:01 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3frvf0e1pf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 03 May 2022 14:40:01 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id EB6BD100039 for ; Tue, 3 May 2022 14:40:00 +0200 (CEST) Received: from Webmail-eu.st.com (gpxdag2node5.st.com [10.75.127.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id CCA3821E678 for ; Tue, 3 May 2022 14:40:00 +0200 (CEST) Received: from gnbcxd0114.gnb.st.com (10.75.127.50) by GPXDAG2NODE5.st.com (10.75.127.69) with Microsoft SMTP Server (TLS) id 15.0.1497.26; Tue, 3 May 2022 14:40:00 +0200 Date: Tue, 3 May 2022 14:39:59 +0200 From: Yvan Roux To: Subject: [PATCH] _bfd_real_fopen should not use ccs parameter on Windows Message-ID: <20220503123959.GD28900@gnbcxd0114.gnb.st.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [10.75.127.50] X-ClientProxiedBy: SFHDAG2NODE3.st.com (10.75.127.6) To GPXDAG2NODE5.st.com (10.75.127.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-03_03,2022-05-02_03,2022-02-23_01 X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 May 2022 12:40:04 -0000 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 Signed-off-by: Yvan ROUX --- 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