From 526deb7d9cfb2999587454cf8ed44c03c1de120e Mon Sep 17 00:00:00 2001 From: skimo Date: Sun, 20 Aug 2000 09:05:36 +0000 Subject: [PATCH] fix reading and filtering in wide char version --- common/mem.h | 4 ++-- ex/ex_filter.c | 5 +++-- ex/ex_util.c | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/common/mem.h b/common/mem.h index e94c28bc..a15b179a 100644 --- a/common/mem.h +++ b/common/mem.h @@ -6,7 +6,7 @@ * * See the LICENSE file for redistribution information. * - * $Id: mem.h,v 10.9 2000/07/15 20:26:34 skimo Exp $ (Berkeley) $Date: 2000/07/15 20:26:34 $ + * $Id: mem.h,v 10.10 2000/08/20 09:05:36 skimo Exp $ (Berkeley) $Date: 2000/08/20 09:05:36 $ */ /* Increase the size of a malloc'd buffer. Two versions, one that @@ -44,7 +44,7 @@ } #define BINC_RETW(sp, lp, llen, nlen) { \ CHAR_T *L__bp = lp; \ - BINC_RET(sp, (char *)lp, llen, nlen * sizeof(CHAR_T)) \ + BINC_RET(sp, (char *)lp, llen, (nlen) * sizeof(CHAR_T)) \ } /* diff --git a/ex/ex_filter.c b/ex/ex_filter.c index 733c92c6..7562feb3 100644 --- a/ex/ex_filter.c +++ b/ex/ex_filter.c @@ -10,7 +10,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "$Id: ex_filter.c,v 10.36 2000/07/14 14:29:20 skimo Exp $ (Berkeley) $Date: 2000/07/14 14:29:20 $"; +static const char sccsid[] = "$Id: ex_filter.c,v 10.37 2000/08/20 09:05:37 skimo Exp $ (Berkeley) $Date: 2000/08/20 09:05:37 $"; #endif /* not lint */ #include @@ -143,7 +143,8 @@ err: if (input[0] != -1) else ++name; - execl(O_STR(sp, O_SHELL), name, "-c", cmd, NULL); + INT2CHAR(sp, cmd, v_strlen(cmd)+1, np, nlen); + execl(O_STR(sp, O_SHELL), name, "-c", np, NULL); msgq_str(sp, M_SYSERR, O_STR(sp, O_SHELL), "execl: %s"); _exit (127); /* NOTREACHED */ diff --git a/ex/ex_util.c b/ex/ex_util.c index 1d3ee858..173d78af 100644 --- a/ex/ex_util.c +++ b/ex/ex_util.c @@ -10,7 +10,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "$Id: ex_util.c,v 10.29 2000/07/22 17:31:21 skimo Exp $ (Berkeley) $Date: 2000/07/22 17:31:21 $"; +static const char sccsid[] = "$Id: ex_util.c,v 10.30 2000/08/20 09:05:37 skimo Exp $ (Berkeley) $Date: 2000/08/20 09:05:37 $"; #endif /* not lint */ #include @@ -70,7 +70,7 @@ ex_getline(sp, fp, lenp) exp = EXP(sp); for (errno = 0, off = 0, p = exp->ibp;;) { - if (off >= exp->ibp_len) { + if (off * sizeof(CHAR_T) >= exp->ibp_len) { BINC_RETW(sp, exp->ibp, exp->ibp_len, off + 1); p = exp->ibp + off; } -- 2.11.4.GIT