Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: zle_params.c



> 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