* [PATCH] cpp/remap: Only override if string matched
@ 2022-10-20 20:48 Torbjörn SVENSSON
2022-11-02 18:21 ` PING^1 " Torbjorn SVENSSON
0 siblings, 1 reply; 5+ messages in thread
From: Torbjörn SVENSSON @ 2022-10-20 20:48 UTC (permalink / raw)
To: gcc-patches; +Cc: tromey, yvan.roux, Torbjörn SVENSSON
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 <torbjorn.svensson@foss.st.com>
---
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
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* PING^1 [PATCH] cpp/remap: Only override if string matched
2022-10-20 20:48 [PATCH] cpp/remap: Only override if string matched Torbjörn SVENSSON
@ 2022-11-02 18:21 ` Torbjorn SVENSSON
2022-11-17 16:44 ` PING^2 " Torbjorn SVENSSON
2022-11-20 20:31 ` PING^1 " Jeff Law
0 siblings, 2 replies; 5+ messages in thread
From: Torbjorn SVENSSON @ 2022-11-02 18:21 UTC (permalink / raw)
To: gcc-patches; +Cc: yvan.roux, Tom Tromey
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 <torbjorn.svensson@foss.st.com>
> ---
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* PING^2 [PATCH] cpp/remap: Only override if string matched
2022-11-02 18:21 ` PING^1 " Torbjorn SVENSSON
@ 2022-11-17 16:44 ` Torbjorn SVENSSON
2022-11-20 20:31 ` PING^1 " Jeff Law
1 sibling, 0 replies; 5+ messages in thread
From: Torbjorn SVENSSON @ 2022-11-17 16:44 UTC (permalink / raw)
To: gcc-patches; +Cc: yvan.roux, Tom Tromey
Hi,
Ping, https://gcc.gnu.org/pipermail/gcc-patches/2022-November/604898.html
Ok for trunk?
Kind regards,
Torbjörn
On 2022-11-02 19:21, Torbjorn SVENSSON wrote:
> 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 <torbjorn.svensson@foss.st.com>
>> ---
>> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PING^1 [PATCH] cpp/remap: Only override if string matched
2022-11-02 18:21 ` PING^1 " Torbjorn SVENSSON
2022-11-17 16:44 ` PING^2 " Torbjorn SVENSSON
@ 2022-11-20 20:31 ` Jeff Law
2022-11-21 12:38 ` Torbjorn SVENSSON
1 sibling, 1 reply; 5+ messages in thread
From: Jeff Law @ 2022-11-20 20:31 UTC (permalink / raw)
To: Torbjorn SVENSSON, gcc-patches; +Cc: Tom Tromey
On 11/2/22 12:21, Torbjorn SVENSSON via Gcc-patches wrote:
> Hi,
>
> Ping, https://gcc.gnu.org/pipermail/gcc-patches/2022-October/604062.html
>
> Ok for trunk?
OK. Sorry for the delay.
jeff
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PING^1 [PATCH] cpp/remap: Only override if string matched
2022-11-20 20:31 ` PING^1 " Jeff Law
@ 2022-11-21 12:38 ` Torbjorn SVENSSON
0 siblings, 0 replies; 5+ messages in thread
From: Torbjorn SVENSSON @ 2022-11-21 12:38 UTC (permalink / raw)
To: Jeff Law, gcc-patches; +Cc: Tom Tromey
Hi,
On 2022-11-20 21:31, Jeff Law wrote:
>
> On 11/2/22 12:21, Torbjorn SVENSSON via Gcc-patches wrote:
>> Hi,
>>
>> Ping, https://gcc.gnu.org/pipermail/gcc-patches/2022-October/604062.html
>>
>> Ok for trunk?
>
> OK. Sorry for the delay.
Thanks for the review.
Pushed.
Kind regards,
Torbjörn
>
> jeff
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-11-21 12:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-20 20:48 [PATCH] cpp/remap: Only override if string matched Torbjörn SVENSSON
2022-11-02 18:21 ` PING^1 " Torbjorn SVENSSON
2022-11-17 16:44 ` PING^2 " Torbjorn SVENSSON
2022-11-20 20:31 ` PING^1 " Jeff Law
2022-11-21 12:38 ` Torbjorn SVENSSON
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).