Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: zle_params.c
- X-seq: zsh-workers 20753
- From: Clint Adams <clint@xxxxxxx>
- To: Peter Stephenson <pws@xxxxxxx>
- Subject: Re: PATCH: zle_params.c
- Date: Wed, 26 Jan 2005 13:35:53 -0500
- Cc: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- In-reply-to: <200501261806.j0QI6Q2d021854@xxxxxxxxxxxxxx>
- Mail-followup-to: Peter Stephenson <pws@xxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <200501261806.j0QI6Q2d021854@xxxxxxxxxxxxxx>
> broken. It also fixes a typo in zle_params.c.
Oops.
> - memmove(zleline + len, zleline + zlecs, zlell - zlecs);
> - memcpy(zleline, y, len);
> + memmove((char *)(zleline + len), (char *)(zleline + zlecs),
> + (zlell - zlecs) * ZLE_CHAR_SIZE);
> + ZS_memcpy(zleline, y, len);
Hmm. For the sake of consistency..
Index: Src/system.h
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/system.h,v
retrieving revision 1.25
diff -u -r1.25 system.h
--- Src/system.h 26 Jan 2005 18:12:18 -0000 1.25
+++ Src/system.h 26 Jan 2005 18:34:04 -0000
@@ -727,6 +727,7 @@
#define ZLETAB L'\t'
#define ZLENULSTR L""
#define ZS_memcpy wmemcpy
+#define ZS_memmove wmemmove
#define ZC_icntrl iswcntrl
#else
typedef int ZLE_CHAR_T;
@@ -738,5 +739,6 @@
#define ZLETAB '\t'
#define ZLENULSTR ""
#define ZS_memcpy memcpy
+#define ZS_memmove memmove
#define ZC_icntrl icntrl
#endif
Index: Src/Zle/zle_params.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_params.c,v
retrieving revision 1.22
diff -u -r1.22 zle_params.c
--- Src/Zle/zle_params.c 26 Jan 2005 18:12:18 -0000 1.22
+++ Src/Zle/zle_params.c 26 Jan 2005 18:34:04 -0000
@@ -242,8 +242,7 @@
else
y = ZLENULSTR, len = 0;
sizeline(zlell - zlecs + len);
- memmove((char *)(zleline + len), (char *)(zleline + zlecs),
- (zlell - zlecs) * ZLE_CHAR_SIZE);
+ ZS_memmove(zleline + len, zleline + zlecs, zlell - zlecs);
ZS_memcpy(zleline, y, len);
zlell = zlell - zlecs + len;
zlecs = len;
Messages sorted by:
Reverse Date,
Date,
Thread,
Author