Subject: Re: bug#16718: bug in vi on linux

From: Pádraig Brady <[email-masked]>
Date: Tue, 11 Feb 2014 09:28:11 +0000

tag 16718 notabug
close 16718
stop

On 02/11/2014 02:02 AM, Cheng Ong wrote:
> Hi there,
> 
> Just encountered a bug in VI.
> Editing file 'x' using vi, when done, content of file 'x' was saved as well in file 'y'.
> File 'y' has no relation to file 'x' and is sitting in a different directory.
> Only relation was file 'x' was created through a cp command from file 'y'.
> Now changes made either on file 'y' or 'x' appear in both files.

I'm guessing you linked the file names.
http://vim.wikia.com/wiki/Editing_a_hard_link_to_a_file

If you can repeat this without specifying any options to cp,
then it might be a bug in cp, but it's quite unlikely,
so I'm closing this for now.

These commands should verify:

env cp x y
[ $(stat -c %i x y | uniq | wc -l) = 1 ] && echo possible cp bug
cp --version

thanks,
Pádraig.