Hi,

If you set PROMPT_DIRTRIM, in some cases strange output displayed in the prompt. I found an issue inside the trim_pathname() function, that uses memcpy() to copy head and tail together. That should not be used if the memory is overlapped and memmove() shall be used instead.

Please find my enclosed patch.

Have a nice day!

Csaba
--- orig/bash-4.2/general.c	2010-12-12 21:06:27.000000000 +0100
+++ modified/bash-4.2/general.c	2014-01-29 12:45:49.762326928 +0100
@@ -766,7 +766,7 @@
   *nbeg++ = '.';
 
   nlen = nend - ntail;
-  memcpy (nbeg, ntail, nlen);
+  memmove(nbeg, ntail, nlen);
   nbeg[nlen] = '\0';
 
   return name;

Reply via email to