From 46c92680a7eca7fb7d64ace0680d7f2f4f29e92a Mon Sep 17 00:00:00 2001 From: bostic Date: Sun, 23 Jan 1994 16:30:20 +0000 Subject: [PATCH] :read sets the alternate file name if one provided, doesn't if reading the current file --- ex/ex_read.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/ex/ex_read.c b/ex/ex_read.c index 7a4f43f4..cc4f105b 100644 --- a/ex/ex_read.c +++ b/ex/ex_read.c @@ -6,7 +6,7 @@ */ #ifndef lint -static char sccsid[] = "$Id: ex_read.c,v 8.20 1993/12/29 09:50:53 bostic Exp $ (Berkeley) $Date: 1993/12/29 09:50:53 $"; +static char sccsid[] = "$Id: ex_read.c,v 8.21 1994/01/23 16:30:20 bostic Exp $ (Berkeley) $Date: 1994/01/23 16:30:20 $"; #endif /* not lint */ #include @@ -82,19 +82,24 @@ ex_read(sp, ep, cmdp) switch (cmdp->argc) { case 1: - /* Nothing to expand, read the current file. */ + /* + * No arguments, read the current file. + * Doesn't set the alternate file name. + */ name = FILENAME(sp->frp); - if (sp->alt_name == NULL) - set_alt_name(sp, name); break; case 2: - /* One new argument, read it. */ + /* + * One argument, read it. + * Sets the alternate file name. + */ name = cmdp->argv[1]->bp; + set_alt_name(sp, name); break; default: /* If expanded to more than one argument, object. */ - msgq(sp, M_ERR, "%s expanded into too many file names", - cmdp->argv[0]->bp); + msgq(sp, M_ERR, + "%s expanded into too many file names", cmdp->argv[0]->bp); msgq(sp, M_ERR, "Usage: %s.", cmdp->cmd->usage); return (1); } -- 2.11.4.GIT