This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: DejaGnu PATCH to lib/dg.exp: enhance support for "exotic" dir-names
Fernando Nasser <fnasser@redhat.com> writes:
| This is what is in there now:
|
|
| # dg-trim-dirname -- rip DIR_NAME out of FILE_NAME
| #
| # Syntax: dg-trim-dirname dir_name file_name
| # We need to go through this contorsion in order to properly support
| # directory-names which might have embedded regexp special characters.
|
| proc dg-trim-dirname { dir_name file_name } {
| set special_character "\[\?\+\-\.\(\)\$\|\]"
| regsub -all $special_character $dir_name "\\\\&" dir_name
| regsub "^$dir_name/?" $file_name "" file_name
| return $file_name
| }
Excellent!
Thank you very much.
-- Gaby
CodeSourcery, LLC http://www.codesourcery.com