Package: fhist / 1.18-2.1

sanitize-bison.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Author: Andreas Beckmann <anbe@debian.org>
Description: sanitize bison usage
 use
   %define api.prefix {...}
 instead of crude
   sed -e 's/[yY][yY]/.../g'

 Thanks to Akim Demaille for the hint! (#960608)

--- a/Makefile.in
+++ b/Makefile.in
@@ -567,11 +567,11 @@ common/sub/expr_gram.gen.c common/sub/ex
 		common/sub/expr_gram.y
 	@echo Expect no conflicts:
 	$(YACC) -d common/sub/expr_gram.y
-	sed -e 's/[yY][yY]/sub_expr_gram_/g' -e '/#include.<stdio.h>/d' \
+	sed -e '/#include.<stdio.h>/d' \
 		-e '/#include.<stdlib.h>/d' -e '/#include.<stddef.h>/d' \
 		-e '/#include.<libintl.h>/d' y.tab.c > \
 		common/sub/expr_gram.gen.c
-	sed -e 's/[yY][yY]/sub_expr_gram_/g' y.tab.h > \
+	sed -e '' y.tab.h > \
 		common/sub/expr_gram.gen.h
 	rm y.tab.c y.tab.h
 
--- a/common/sub/expr_gram.y
+++ b/common/sub/expr_gram.y
@@ -17,6 +17,8 @@
  *      <http://www.gnu.org/licenses/>.
  */
 
+%define api.prefix {sub_expr_gram_}
+
 %{
 
 #include <ac/stdarg.h>