This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: fix PR 22232


I've Cc'ed Per as he has hacked on this script and I can't work out who
else might be its maintainer.

This patch fixes a problem reported in PR 22232.  Although the bug
submitter has long since worked around the problem, his complaint has
identified an obvious bug in fixprotos.  The submitter reported that the
script misbehaved when he had a source (or build?) subdirectory
consisting of a single letter (d/), such that it was matched by the
regular expression "^./"

If we really want to match ./ as typically produced by find(1), we
should escape it properly.  Okay for stage 1?

Ben


2008-01-22  Ben Elliston  <bje@au.ibm.com>

	PR other/22232
        * fixproto: Escape "." in sed expression that strips leading "./".

Index: gcc-trunk/gcc/fixproto
===================================================================
--- gcc-trunk.orig/gcc/fixproto 2008-01-22 10:52:44.000000000 +1100
+++ gcc-trunk/gcc/fixproto      2008-01-22 10:52:52.000000000 +1100
@@ -197,7 +197,7 @@
        fi
       fi
       # Append "/"; remove initial "./". Hence "." -> "" and "sys" -> "sys/".
-      rel_source_prefix=`echo $rel_source_subdir | sed -e 's|$|/|' -e 's|^./||'`
+      rel_source_prefix=`echo $rel_source_subdir | sed -e 's|$|/|' -e 's|^\./||'`
 
       case $code in
        ALL)



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]