From b1bbb41f966a04488da73f35fe397e07b502ca99 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 7 Mar 2013 21:34:16 +0000 Subject: [PATCH] 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 --- usr.bin/c89/c89.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/c89/c89.c b/usr.bin/c89/c89.c index a1dc9b2a6238..930153fcb919 100644 --- a/usr.bin/c89/c89.c +++ b/usr.bin/c89/c89.c @@ -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) {