delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/06/13/12:03:36

Date: Thu, 13 Jun 2002 11:17:22 -0400
Message-Id: <200206131517.g5DFHMK17587@envy.delorie.com>
X-Authentication-Warning: envy.delorie.com: dj set sender to dj AT delorie DOT com using -f
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp-workers AT delorie DOT com
In-reply-to: <3D08D753.9898.186F2D1@localhost> (pavenis@lanet.lv)
Subject: Re: gcc-3.1: old problem with temporary files
References: <3D08D753 DOT 9898 DOT 186F2D1 AT localhost>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> The included patch seems to fix it (perhaps it could also be usefull for 
> WIndows targets). I'm not sure however that it's required
> to rerelease gcc-3.1 for DJGPP as 3.1.1 should be about after slightly more 
> than a month (according http://gcc.gnu.org/develop.html)

Libiberty patches go to gcc-patches AT gcc DOT gnu DOT org.  There's no reason
why this change couldn't be independent of djgpp, but it needs to use
DIR_SEPARATOR and DIR_SEPARATOR_2 instead of hardcoding '\' and '/'.
And make sure [len-1] isn't before the start of tmpdir.

> Andris
> 
> --- gcc-3.1/libiberty/make-temp-file.c~1	Thu Oct 18 00:15:40 2001
> +++ gcc-3.1/libiberty/make-temp-file.c	Thu Jun 13 17:06:40 2002
> @@ -126,6 +126,9 @@
>    len = strlen (base);
>    tmpdir = xmalloc (len + 2);
>    strcpy (tmpdir, base);
> +#ifdef __DJGPP__
> +  if (tmpdir[len-1]!='/' && tmpdir[len-1]!='\\')   
> +#endif
>    tmpdir[len] = DIR_SEPARATOR;
>    tmpdir[len+1] = '\0';
>  
> 
> 
> 
> 
> 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019