Fix for GCC PR17040 (GCOV and directory separators on Windows)

Nathan Sidwell nathan@codesourcery.com
Mon Aug 16 09:55:00 GMT 2004


Pascal Obry wrote:
> Here is the ChangeLog entry and the corresponding fix.
> 
> 2004-08-16  Pascal Obry  <obry@act-europe.fr>
> 
>         * gcov.c: Properly handle directory separators on DOS based file
> 	systems.
> 	Fixes GCC PR17040
this should be written as
	PR gcc/17040
	* gcov.c (function): change
	(function): change

I'd suggest first_dir_sep and last_dir_sep rather than l_strchr and l_strrchr.
They also need comments. Do DOS base 'C:' drive names need special treatment?
I'd also find a for loop, with the end-of-string test in the
for () bit, and the IS_DIR_SEPARATOR bit in the loop, easier to understand.

Also could you inline your patch (or mark it as text type), that'd make it
easier to read.

You should also indictate how you tested the patch.

nathan

-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk




More information about the Gcc-patches mailing list