From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by sourceware.org (Postfix) with ESMTPS id C06663858D3C for ; Tue, 17 May 2022 14:33:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C06663858D3C Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24HESV8P020575 for ; Tue, 17 May 2022 16:33:42 +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 3g23ahjvc7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 17 May 2022 16:33:42 +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 ED0A710002A for ; Tue, 17 May 2022 16:33:41 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag2node2.st.com [10.75.127.5]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id A4FEF2291CC for ; Tue, 17 May 2022 16:33:41 +0200 (CEST) Received: from gnbcxd0114.gnb.st.com (10.75.127.51) by SFHDAG2NODE2.st.com (10.75.127.5) with Microsoft SMTP Server (TLS) id 15.0.1497.26; Tue, 17 May 2022 16:33:40 +0200 Date: Tue, 17 May 2022 16:33:40 +0200 From: Yvan Roux To: Subject: Re: [PATCH] _bfd_real_fopen should not use ccs parameter on Windows Message-ID: <20220517143340.GE27993@gnbcxd0114.gnb.st.com> References: <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 In-Reply-To: <20220503123959.GD28900@gnbcxd0114.gnb.st.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [10.75.127.51] X-ClientProxiedBy: SFHDAG2NODE3.st.com (10.75.127.6) To SFHDAG2NODE2.st.com (10.75.127.5) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-17_03,2022-05-17_02,2022-02-23_01 X-Spam-Status: No, score=-11.4 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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, 17 May 2022 14:33:45 -0000 Ping On Tue, May 03, 2022 at 02:39:59PM +0200, Yvan Roux via Binutils wrote: > 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 > > > -- Y.