diff options
author | Anders Magnusson <ragge@cvs.openbsd.org> | 2007-10-07 07:58:52 +0000 |
---|---|---|
committer | Anders Magnusson <ragge@cvs.openbsd.org> | 2007-10-07 07:58:52 +0000 |
commit | efbffc5546810eda09bef509e9c12159c7febf43 (patch) | |
tree | 6739c3582c45e8bc4dd49af6633fb1c3b4eaab10 | |
parent | f5461d41b129fefc48ff4c9ded82554394de9bf0 (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.l | 9 |
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(); |