www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/03/20/03:34:05

From: pavenis AT lanet DOT lv
To: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>, djgpp-workers AT delorie DOT com
Date: Tue, 20 Mar 2001 10:32:37 +0200
MIME-Version: 1.0
Subject: Re: About release of gcc-2.95.3 for DJGPP
Message-ID: <3AB731C5.14351.37D0EA@localhost>
In-reply-to: <7263-Mon19Mar2001220417+0200-eliz@is.elta.co.il>
References: <3AB63383 DOT 27090 DOT 141E220 AT localhost> (pavenis AT lanet DOT lv)
X-mailer: Pegasus Mail for Win32 (v3.12c)
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

On 19 Mar 2001, at 22:04, Eli Zaretskii wrote:

> > From: pavenis AT lanet DOT lv
> > Date: Mon, 19 Mar 2001 16:27:47 +0200
> Is gcov_file_name an absolute file name or just the last portion,
> without leading directories?  If the former, you will find the wrong
> dot, if some of the leading directories have dots in their names.

Of course I should use basename() there. But as it was stated in 
another message, this can cause data loss on non LFN systems when
some veird file extensions are being used.

Andris

--- gcov.c~1	Mon Mar 19 15:55:38 2001
+++ gcov.c	Tue Mar 20 09:49:12 2001
@@ -1284,6 +1284,23 @@
 	     the same basename, e.g. tmp.c and tmp.h.  */
 	  strcat (gcov_file_name, ".gcov");
 
+#ifdef __DJGPP__
+     if (!_use_lfn(gcov_file_name))
+       {
+           char *s1, *s2=NULL;
+           for (s1=basename(gcov_file_name); *s1 && *s1!='.'; s1++);
+           if (*s1) for (s2=s1+1; *s2 && *s2!='.'; s2++);
+           if (s2 && *s2=='.')
+             {
+                 int l;
+                 s1++;  l=s2-s1;  if (l>2) l=2;
+                 s1 = s1+l;  s2++;
+                 while (*s2) { *s1++=*s2++; }
+                 *s1=0;
+             }
+       }
+#endif
+
 	  gcov_file = fopen (gcov_file_name, "w");
 
 	  if (gcov_file == NULL)

- Raw text -


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