Re: trim_pathname in general.c should use memmove rather than memcpy

2013-03-14 Thread Chet Ramey
On 3/13/13 5:17 PM, Matthew Riley wrote: > ... > nlen = nend - ntail; > memcpy (nbeg, ntail, nlen); > nbeg[nlen] = '\0'; > > return name; > ... > > [nbeg, nbeg+nlen) and [ntail, ntail+nlen) can overlap, so this code should > use memmove. I'm pretty sure this explains why sometimes using >

trim_pathname in general.c should use memmove rather than memcpy

2013-03-13 Thread Matthew Riley
... nlen = nend - ntail; memcpy (nbeg, ntail, nlen); nbeg[nlen] = '\0'; return name; ... [nbeg, nbeg+nlen) and [ntail, ntail+nlen) can overlap, so this code should use memmove. I'm pretty sure this explains why sometimes using PROMPT_DIRTRIM will give me a prompt with the last few compone