Panu Matilainen d06308
commit bf92b843fabd6c9881b19efb0cae1578d16e4f7b
Panu Matilainen d06308
Author: Panu Matilainen <pmatilai@redhat.com>
Panu Matilainen d06308
Date:   Tue Feb 28 12:18:10 2012 +0200
Panu Matilainen d06308
Panu Matilainen d06308
    Don't process spec %include in false branch of %if clauses (RhBug:782970)
Panu Matilainen d06308
    (backported from commit 9defc922e971d98203890f1557ab951ec94f2a3f)
Panu Matilainen d06308
Panu Matilainen d06308
diff --git a/build/parseSpec.c b/build/parseSpec.c
Panu Matilainen d06308
index 01620bd..01c3c08 100644
Panu Matilainen d06308
--- a/build/parseSpec.c
Panu Matilainen d06308
+++ b/build/parseSpec.c
Panu Matilainen d06308
@@ -374,7 +374,8 @@ int readLine(rpmSpec spec, int strip)
Panu Matilainen d06308
 	spec->readStack = spec->readStack->next;
Panu Matilainen d06308
 	free(rl);
Panu Matilainen d06308
 	spec->line[0] = '\0';
Panu Matilainen d06308
-    } else if (rstreqn("%include", s, sizeof("%include")-1)) {
Panu Matilainen d06308
+    } else if (spec->readStack->reading &&
Panu Matilainen d06308
+	       rstreqn("%include", s, sizeof("%include")-1)) {
Panu Matilainen d06308
 	char *fileName, *endFileName, *p;
Panu Matilainen d06308
 
Panu Matilainen d06308
 	s += 8;