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:
Dimitry Andric 2013-03-07 21:34:16 +00:00
parent 7f33ac6697
commit b1bbb41f96
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=247951

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) {