From 92663acdd41cac1224b4ca3a172965c39000df08 Mon Sep 17 00:00:00 2001 From: bostic Date: Thu, 2 Dec 1993 10:47:41 +0000 Subject: [PATCH] rework ARGS structures as part of ex parser rework file names don't need associated lengths -- they are never going to handle inserted nul's since POSIX.1 open's don't --- ex/ex_file.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ex/ex_file.c b/ex/ex_file.c index 21c58956..b7dbb187 100644 --- a/ex/ex_file.c +++ b/ex/ex_file.c @@ -6,7 +6,7 @@ */ #ifndef lint -static char sccsid[] = "$Id: ex_file.c,v 8.6 1993/11/26 16:22:42 bostic Exp $ (Berkeley) $Date: 1993/11/26 16:22:42 $"; +static char sccsid[] = "$Id: ex_file.c,v 8.7 1993/12/02 10:47:41 bostic Exp $ (Berkeley) $Date: 1993/12/02 10:47:41 $"; #endif /* not lint */ #include @@ -38,21 +38,19 @@ ex_file(sp, ep, cmdp) frp = sp->frp; /* Make sure can allocate enough space. */ - if ((p = strdup((char *)cmdp->argv[0])) == NULL) { + if ((p = strdup(cmdp->argv[0]->bp)) == NULL) { msgq(sp, M_SYSERR, NULL); return (1); } /* If already have a file name, it becomes the alternate. */ - t = FILENAME(frp); - if (t != NULL) + if ((t = FILENAME(frp)) != NULL) set_alt_name(sp, t); /* Free any previously changed name. */ if (frp->cname != NULL) - FREE(frp->cname, frp->clen); + free(frp->cname); frp->cname = p; - frp->clen = strlen(p); /* The read-only bit follows the file name; clear it. */ F_CLR(frp, FR_RDONLY); -- 2.11.4.GIT