summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-02-03 22:51:11 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-02-20 14:28:01 +0100
commit2fe3af2334733053ba7c0911647e9ba4b16cef55 (patch)
tree33240a4c7bee8bb3679e3b02419cc0197a93d4cf
parentbb1bf748580d1794f8da7200ba83ccfc2f2f3a8a (diff)
downloadsparse-2fe3af2334733053ba7c0911647e9ba4b16cef55.tar.gz
cgcc: -MF, -MQ & -MT need an argument
These flags expect an argument. So, the following element in '@ARGV' must then not be considered as an option or an input file, exactly like done for '-o FILE'. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rwxr-xr-xcgcc8
1 files changed, 4 insertions, 4 deletions
diff --git a/cgcc b/cgcc
index 6d3b10a2..e64e8c14 100755
--- a/cgcc
+++ b/cgcc
@@ -31,10 +31,10 @@ while (@ARGV) {
# Ditto for stdin.
$do_check = 1 if $_ eq '-';
- if ($_ eq '-o') {
- # Need to be checked explicitly since '-o -' is
- # sometimes used and the '-' would otherwise be
- # processed as an option.
+ if (/^-(o|MF|MT|MQ)$/) {
+ # Need to be checked explicitly since otherwise
+ # the argument would be processed as a
+ # (non-existant) source file or as an option.
die ("$0: missing argument for $_") if !@ARGV;
$nargs = 1;
}