On 2011-05-23 15:21 +0800, Eli Zaretskii wrote: >> From: Leo >> Date: Mon, 23 May 2011 04:02:04 +0800 >> >> 1. add sha1.[ch] from gnulib > > Note that gnulib's sha1.c uses malloc, which is not safe in Emacs. > So either make sure sha1_stream is never ever called by Emacs, or use > xmalloc instead. Thanks for this note. sha1_stream is not used. >> Should the signature of sha1 stay as is or change to be similar to md5? >> >> (md5 OBJECT &optional START END CODING-SYSTEM NOERROR) > > Are there any real reasons not to keep the API? If there are good > reasons, let's hear them. If there are no good reasons, my vote is to > keep the API backward-compatible. I think it is better to keep the API. The BINARY arg can be useful. Please review the attached patch. ChangeLog entry omitted for now. Changes due to 'make sync-from-gnulib' aren't included.