summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Magnusson <ragge@cvs.openbsd.org>2007-10-07 07:58:52 +0000
committerAnders Magnusson <ragge@cvs.openbsd.org>2007-10-07 07:58:52 +0000
commitefbffc5546810eda09bef509e9c12159c7febf43 (patch)
tree6739c3582c45e8bc4dd49af6633fb1c3b4eaab10
parentf5461d41b129fefc48ff4c9ded82554394de9bf0 (diff)
From master repo:
> Don't let pragmas pass through if #ifdef'd away, from Stefan Kempf.
-rw-r--r--usr.bin/pcc/cc/cpp/scanner.l9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/pcc/cc/cpp/scanner.l b/usr.bin/pcc/cc/cpp/scanner.l
index 5bb0dc51365..94656769f3c 100644
--- a/usr.bin/pcc/cc/cpp/scanner.l
+++ b/usr.bin/pcc/cc/cpp/scanner.l
@@ -1,5 +1,5 @@
%{
-/* $OpenBSD: scanner.l,v 1.8 2007/09/28 17:59:45 otto Exp $ */
+/* $OpenBSD: scanner.l,v 1.9 2007/10/07 07:58:51 ragge Exp $ */
/*
* Copyright (c) 2004 Anders Magnusson. All rights reserved.
@@ -804,9 +804,12 @@ pragmastmt(void)
slow = 1;
if (yylex() != WSPACE)
error("bad pragma");
- putstr((usch *)"#pragma ");
+ if (!flslvl)
+ putstr((usch *)"#pragma ");
do {
- putch(c = input()); /* Do arg expansion instead? */
+ c = input();
+ if (!flslvl)
+ putch(c); /* Do arg expansion instead? */
} while (c && c != '\n');
ifiles->lineno++;
prtline();