https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108182

--- Comment #15 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Iain Sandoe from comment #14)
> Created attachment 54261 [details]
> Updated patch that honours the order of include use.
> 
> This is V5 ...
> 
> ... so here we collect the incoming search paths and then apply (most of)
> the rules in 
> https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html#Directory-Options
> 
> ... TODO:
>  - eliminate duplicate -I entries that have a system one
>  - figure out the right way to implement -nostdinc 
>  - handle -idirafter

add this missed hunk.

diff --git a/gcc/m2/gm2-lang.cc b/gcc/m2/gm2-lang.cc
index 073d1dd55db..cd59784d7b2 100644
--- a/gcc/m2/gm2-lang.cc
+++ b/gcc/m2/gm2-lang.cc
@@ -513,6 +513,7 @@ add_m2_import_paths (const char *liblist)
     {
       char *libname = (char *) alloca (6);
       strncpy (libname, liblist, 5);
+      libname[5] = 0;
       add_one_import_path (libname);
       liblist += 5;
       if (*liblist == ',')

Reply via email to