From: matthieu Date: Sat, 12 Jul 2014 16:32:07 +0000 (+0000) Subject: Local tweaks to ucpp: X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a7310b1a4f3e3f3fc72abecf9fc7487bcb42046b;p=openbsd Local tweaks to ucpp: - exit on the 1st error it finds. Better than stopping processing input - accept -P as a synonym for -l since this is what xrdb uses to suppress #line markers. --- diff --git a/libexec/auxcpp/auxcpp.1 b/libexec/auxcpp/auxcpp.1 index 40ec7f36a77..f0b15bf275e 100644 --- a/libexec/auxcpp/auxcpp.1 +++ b/libexec/auxcpp/auxcpp.1 @@ -27,7 +27,7 @@ keep comments in the output. if a rogue '#' is encountered, do not emit an error and keep it in the output. .TP -.BI \-l +.B \-l, \-P supress the emission of '#line' directives in the output. .TP .BI \-lg diff --git a/libexec/auxcpp/cpp.c b/libexec/auxcpp/cpp.c index 7cdc358cac6..f79abd5e994 100644 --- a/libexec/auxcpp/cpp.c +++ b/libexec/auxcpp/cpp.c @@ -115,6 +115,7 @@ void ucpp_error(long line, char *fmt, ...) freemem(sc); } va_end(ap); + exit(1); } /* @@ -2418,6 +2419,8 @@ static int parse_opt(int argc, char *argv[], struct lexer_state *ls) ls->flags &= ~FAIL_SHARP; } else if (!strcmp(argv[i], "-l")) { ls->flags &= ~LINE_NUM; + } else if (!strcmp(argv[i], "-P")) { + ls->flags &= ~LINE_NUM; } else if (!strcmp(argv[i], "-lg")) { ls->flags |= GCC_LINE_NUM; } else if (!strcmp(argv[i], "-M")) {