Author: dim
Date: Thu Mar  7 21:34:16 2013
New Revision: 247951
URL: http://svnweb.freebsd.org/changeset/base/247951

Log:
  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

Modified:
  head/usr.bin/c89/c89.c

Modified: head/usr.bin/c89/c89.c
==============================================================================
--- head/usr.bin/c89/c89.c      Thu Mar  7 21:34:04 2013        (r247950)
+++ head/usr.bin/c89/c89.c      Thu Mar  7 21:34:16 2013        (r247951)
@@ -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) {
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to