This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[fixinc/inclhack.??? patch] double slash & expr problem
- To: egcs-bugs at egcs dot cygnus dot com, egcs-patches at egcs dot cygnus dot com
- Subject: [fixinc/inclhack.??? patch] double slash & expr problem
- From: korbb at egcs dot cygnus dot com
- Date: 9 Apr 1999 16:53:38 -0000
- Cc: ddsinc09 at ix dot netcom dot com
Reply-To: ddsinc09@ix.netcom.com
This patch would address several issues in inclhack.{def|tpl}:
:
1. the file name lists ought to be restricted to "*.h" anyway
2. C++ files may be named .../[a-z]++/... also
3. the original egrep pattern was not finding "__MIPSEL".
I am not enough of a regexp person to know why.
4. Adding copyright year and attribution to output
Is Monday enough of a delay?
Regards,
Bruce
Index: inclhack.def
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/fixinc/inclhack.def,v
retrieving revision 1.9
diff -u -r1.9 inclhack.def
--- inclhack.def 1999/04/02 11:02:36 1.9
+++ inclhack.def 1999/04/09 16:40:33
@@ -328,11 +328,13 @@
fix = {
hackname = no_double_slash;
/*
- * Test that the file-to-fix does not look like a C++ file
+ * Test that the file-to-fix does not from a C++ directory
+ * Also, only accept double slashes that are not part of URL's
+ * and are not the end of a quoted string.
*/
- test = '-z "`echo ${file}|egrep \'(cxx/|\+\+$|\.hh$|\.H$|\.hxx$)\'`"';
- select = '//[^"*]';
- sed = '/\/\/[^"*]/' "s|//.*$||g";
+ test = '-z `echo ${file} | egrep \'(cxx|\+\+)/\' `';
+ select = '(^|[^:])//[^"*]';
+ sed = '/\(^|[^:]\)\/\/[^"*]/' "s|//.*$||g";
};
@@ -827,14 +829,12 @@
exesel = "^#[ \t]*(if|elif).*[^a-zA-Z0-9_]"
"("
"M32"
- "|_*("
- "MIPSE[LB]"
- "|SYSTYPE_[A-Z0-9]"
- "|[Rr][34]000"
- "|host_mips"
- "|i386"
- "|mips"
- ")($|[^a-zA-Z0-9_])"
+ "|_*MIPSE[LB]"
+ "|_*SYSTYPE_[A-Z0-9]"
+ "|_*[Rr][34]000"
+ "|_*host_mips"
+ "|_*i386"
+ "|_*mips"
"|bsd4"
"|is68k"
"|m[68]8k"
Index: inclhack.tpl
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/fixinc/inclhack.tpl,v
retrieving revision 1.7
diff -u -r1.7 inclhack.tpl
--- inclhack.tpl 1999/04/07 11:47:32 1.7
+++ inclhack.tpl 1999/04/09 16:48:47
@@ -15,6 +15,9 @@
#
# See README-fixinc for more information.
#
+# fixincludes copyright (c) [=_eval "date +%Y" _shell
+ =] The Free Software Foundation, Inc.
+#
[=_eval fixincludes "## " _gpl=]
#
# # # # # # # # # # # # # # # # # # # # #
@@ -334,9 +337,9 @@
cd ${INPUT}[=
_IF PROGRAM _env ! =]
files=`if $LINKS; then
- find ${FIND_BASE}/. \( -type f -o \( -type l -exec test ! -d {} \; \) \) -print
+ find ${FIND_BASE}/. -name '*.h' \( -type f -o -type l \) -print
else
- find ${FIND_BASE}/. -type f -print
+ find ${FIND_BASE}/. -name '*.h' -type f -print
fi | \
sed -e 's;/\./;/;g' -e 's;//*;/;g' `
[=
@@ -347,9 +350,9 @@
=]
required="$required `if $LINKS; then
- find ${FIND_BASE}/. \( -type f -o -type l \) -print
+ find ${FIND_BASE}/. -name '*.h' \( -type f -o -type l \) -print
else
- find ${FIND_BASE}/. -type f -print
+ find ${FIND_BASE}/. -name '*.h' -type f -print
fi | \
sed -e 's;/\./;/;g' -e 's;//*;/;g' | \
${FIXINCL}`"[=