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 C936E3858404 for ; Wed, 2 Nov 2022 18:21:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C936E3858404 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=foss.st.com Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2A2FQU2Z030668; Wed, 2 Nov 2022 19:21:15 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=4zcalaeqH+yRQAKEM6X/R6yOYTuiCb3NOdobCOMCCHc=; b=d5wiumfquh8FgW22IAY0RPub1CFyoxFAjZpa6vNPRJksWTJSrdKa8GNUQDn8CHExEL0/ C5yw88GVusz2g+FG5SgyTqssQ1pX8GxCWdvt+JT6FFwitpZKSqPkQa9WLCbs9l9Z78JC jaZq8HAXTdroy7UWT8sDnlJbBU5W4OKfGQNi4jYx2I7Y9goa3EnWus1b1uSUinetu37c 09zhYneJ6i/ndAUDn1OXH4K+rFxmG0gLpjBz2HQnYHMPdbq5HM4Ex8vhtPf8p7nDAMJ0 lcal03TCRyLRSc8qJJH8pVKaf6zp4r99RZxlejTY5yg/miHkV/5374PPr+rS+IvxxiR4 2w== 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 3kkqjctf5a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Nov 2022 19:21:15 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 86EEE10002A; Wed, 2 Nov 2022 19:21:10 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 145FF226FBC; Wed, 2 Nov 2022 19:21:10 +0100 (CET) Received: from [10.252.13.210] (10.252.13.210) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 2 Nov 2022 19:21:09 +0100 Message-ID: Date: Wed, 2 Nov 2022 19:21:08 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: PING^1 [PATCH] cpp/remap: Only override if string matched Content-Language: en-US To: CC: , Tom Tromey References: <20221020204825.3248771-1-torbjorn.svensson@foss.st.com> From: Torbjorn SVENSSON In-Reply-To: <20221020204825.3248771-1-torbjorn.svensson@foss.st.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.252.13.210] X-ClientProxiedBy: EQNCAS1NODE4.st.com (10.75.129.82) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-02_14,2022-11-02_01,2022-06-22_01 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi, Ping, https://gcc.gnu.org/pipermail/gcc-patches/2022-October/604062.html Ok for trunk? Kind regards, Torbjörn On 2022-10-20 22:48, Torbjörn SVENSSON wrote: > For systems with HAVE_DOS_BASED_FILE_SYSTEM set, only override the > pointer if the backslash pattern matches. > > Output without this patch: > .../gcc/testsuite/gcc.dg/cpp/pr71681-2.c:5:10: fatal error: a/t2.h: No such file or directory > > With patch applied, no output and the test case succeeds. > > libcpp/ChangeLog > > * files.cc: Ensure pattern matches before use. > > Signed-off-by: Torbjörn SVENSSON > --- > libcpp/files.cc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libcpp/files.cc b/libcpp/files.cc > index 24208f7b0f8..a18b1caf48d 100644 > --- a/libcpp/files.cc > +++ b/libcpp/files.cc > @@ -1833,7 +1833,7 @@ remap_filename (cpp_reader *pfile, _cpp_file *file) > #ifdef HAVE_DOS_BASED_FILE_SYSTEM > { > const char *p2 = strchr (fname, '\\'); > - if (!p || (p > p2)) > + if (!p || (p2 && p > p2)) > p = p2; > } > #endif