Make c89(1) invoke /usr/bin/cc with argv[0] also set to /usr/bin/cc,

similar to what c99(1) does, to prevent "c89: illegal option -- 1"
messages, when clang is /usr/bin/cc.

Reported by:	tijl
MFC after:	3 days
This commit is contained in:
dim 2013-03-07 21:34:16 +00:00
parent 0212924a12
commit 17adc22cdb

View File

@ -72,7 +72,7 @@ main(int argc, char **argv)
Argv.a = malloc((argc + 1 + N_ARGS_PREPENDED) * sizeof *Argv.a);
if (Argv.a == NULL)
err(1, "malloc");
Argv.a[Argc++] = argv[0];
Argv.a[Argc++] = CC;
for (j = 0; j < N_ARGS_PREPENDED; ++j)
Argv.a[Argc++] = args_prepended[j];
while ((i = getopt(argc, argv, "cD:EgI:l:L:o:OsU:")) != -1) {