patch: fixincludes alpha-osf4, ioctl_fix_ctrl #define _ISCTRL()

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Fri Jun 11 08:01:00 GMT 1999


	Here's an incorrect diff created by both the old and the new
fixincludes on alpha-osf4 in /usr/include/curshdr.h.

< #define _ISCTRL(c)    ((c) < ' ' || (c) == _CTRL('?'))
---
> #define _ISCTRL('c')  ((c) < ' ' || (c) == _CTRL('?'))


	The patch below fixes it, but it might be better to just do
the following instead of the three sed's looking for a define:

 >     sed = "/#[ \t]*define[ \t]*[ \t][A-Z0-9_]*CTRL/"
 >               "s/'\\([cgx]\\)'/\\1/g";

	This'll find all the necessary defines of *CTRL() However the
following patch is more narrow and thus safer.

		--Kaveh

PS: Are we still maintaining the old fixincludes script?  If so, let
me know and then I'll supply a patch for that too.



1999-06-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* inclhack.def (ioctl_fix_ctrl): Fix the definition of [_]*ISCTRL().

--- orig/egcs-CVS19990610/gcc/fixinc/inclhack.def	Thu Jun 10 12:55:48 1999
+++ egcs-CVS19990610/gcc/fixinc/inclhack.def	Fri Jun 11 09:47:12 1999
@@ -594,7 +594,7 @@ fix = {
  * ANSI macro substitution rules prohibit looking inside quoted strings
  * for the substitution names.  A side effect is that the quotes are
  * inserted in the definitions of those macros as well.  So, the last
- * three sed expressions are supposed to clean up the definitions, as
+ * several sed expressions are supposed to clean up the definitions, as
  * long as those definitions are using "c", "g" or "x" as the macro
  * argument :).  Yuck.
  */
@@ -615,6 +615,9 @@ fix = {
               "s/'\\([cgx]\\)'/\\1/g";
 
     sed = "/#[ \t]*define[ \t]*[ \t]BSD43_CTRL/"
+              "s/'\\([cgx]\\)'/\\1/g";
+
+    sed = "/#[ \t]*define[ \t]*[ \t][_]*ISCTRL/"
               "s/'\\([cgx]\\)'/\\1/g";
 };
 


More information about the Gcc-patches mailing list