cc-wrapper: Don't treat "-" alone as a flag
It means stdin, and is morally equivalent to passing a file. e.g.
$ echo 'int main(void) { return 0; }' | gcc -x c -
will compile and link a binary.
This commit is contained in:
@@ -59,7 +59,8 @@ while (( "$n" < "$nParams" )); do
|
|||||||
cppInclude=0
|
cppInclude=0
|
||||||
elif [ "$p" = -nostdinc++ ]; then
|
elif [ "$p" = -nostdinc++ ]; then
|
||||||
cppInclude=0
|
cppInclude=0
|
||||||
elif [ "${p:0:1}" != - ]; then
|
elif [[ "$p" != -?* ]]; then
|
||||||
|
# A dash alone signifies standard input; it is not a flag
|
||||||
nonFlagArgs=1
|
nonFlagArgs=1
|
||||||
fi
|
fi
|
||||||
n+=1
|
n+=1
|
||||||
|
|||||||
Reference in New Issue
Block a user