diff --git a/common/exf.c b/common/exf.c index 112220f..2ed624f 100644 --- a/common/exf.c +++ b/common/exf.c @@ -573,6 +573,7 @@ file_cinit(SCR *sp) "-C option", gp->C_option, strlen(gp->C_option), 1, 1)) return; gp->C_option = NULL; + gp->c_option = NULL; } else if (gp->c_option != NULL && !F_ISSET(sp->frp, FR_NEWFILE)) { if (db_last(sp, &sp->lno)) return; diff --git a/common/main.c b/common/main.c index 3c03746..6eba940 100644 --- a/common/main.c +++ b/common/main.c @@ -167,8 +167,8 @@ editor(GS *gp, int argc, char *argv[]) * Should we support multiple -C options? */ - if (gp->C_option != NULL) { - openbsd_warnx("only one -C command may be specified."); + if (gp->c_option != NULL || gp->C_option != NULL) { + openbsd_warnx("only one -c or -C command may be specified."); return (1); } gp->C_option = openbsd_optarg; @@ -180,8 +180,8 @@ editor(GS *gp, int argc, char *argv[]) * We should support multiple -c options. */ - if (gp->c_option != NULL) { - openbsd_warnx("only one -c command may be specified."); + if (gp->C_option != NULL || gp->c_option != NULL) { + openbsd_warnx("only one -c or -C command may be specified."); return (1); } gp->c_option = openbsd_optarg; diff --git a/docs/USD.doc/vi.man/vi.1 b/docs/USD.doc/vi.man/vi.1 index b4ae40b..ec048d8 100644 --- a/docs/USD.doc/vi.man/vi.1 +++ b/docs/USD.doc/vi.man/vi.1 @@ -103,7 +103,7 @@ This is the POSIX 1003.2 interface for the historic syntax. .Nm oex Ns / Ns Nm ovi supports both the old and new syntax. This option is mutally -exclusive with "-C"; if both are specified, "-C" takes precedence. +exclusive with "-C". .It Fl C Ar cmd Execute .Ar cmd @@ -113,8 +113,7 @@ from the .Pa $HOME/.nexrc or .Pa $HOME/.exrc -files. This option is mutually exclusive with "-c"; if both are -specified, this option takes precedence. +files. This option is mutually exclusive with "-c". .It Fl e Start editing in ex mode, as if the command name were .Nm ex .