[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in copy-file

From: Lars Hansen
Subject: Re: Bug in copy-file
Date: Fri, 31 Jan 2003 08:36:45 +0100
User-agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.2.1) Gecko/20021130

Andreas Schwab wrote:

Lars Hansen <address@hidden> writes:

|> A bug has been introduced since Emacs 21.2.
|> A "!" has been added where it should not be.
|> As a consequence the keep-time parameter functions
|> opposite of what is intended. The patch below
|> should fix the problem.

Why do you think so?  The use of keep-time is correct according to the
doc string.


Maybe I am misreading the code or the doc string. I read them like this:
Doc string says:

   Fourth arg KEEP-TIME non-nil means give the new file the same
   last-modified time as the old one.

But when keep_time is non-nil, NILP (keep_time) is false, so !NILP
is true. Thus the code following if (NILP (keep_time)) is entered. In
this code it

      EMACS_GET_TIME (now);


      if (set_file_times (filename, now, now))

so the time is set to now, not kept.

Am I wrong?
By the way, it is easy to test: Just do eg:

   (copy-file "junk" "keep" t t)
   (copy-file "junk" "new" t nil)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]