X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fsha1.el;h=3f2e8f2a69b2aacddc91c2c3d2a38428853f0c5a;hb=6d225814ad9bb5ebd7047a4c3b2117ba6a4f5894;hp=2b082c1ccd37ab878f26e61cb79d2c301f0e348b;hpb=8b5af94e55ef83ee46b42d32d92fa1ce95dcacf5;p=gnus diff --git a/lisp/sha1.el b/lisp/sha1.el index 2b082c1cc..3f2e8f2a6 100644 --- a/lisp/sha1.el +++ b/lisp/sha1.el @@ -1,7 +1,6 @@ ;;; sha1.el --- SHA1 Secure Hash Algorithm in Emacs-Lisp -;; Copyright (C) 1999, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +;; Copyright (C) 1999, 2001-2011 Free Software Foundation, Inc. ;; Author: Shuhei KOBAYASHI ;; Keywords: SHA1, FIPS 180-1 @@ -63,7 +62,7 @@ :group 'extensions) (defcustom sha1-maximum-internal-length 500 - "*Maximum length of message to use Lisp version of SHA1 function. + "Maximum length of message to use Lisp version of SHA1 function. If message is longer than this, `sha1-program' is used instead. If this variable is set to 0, use external program only. @@ -72,7 +71,7 @@ If this variable is set to nil, use internal function only." :group 'sha1) (defcustom sha1-program '("sha1sum") - "*Name of program to compute SHA1. + "Name of program to compute SHA1. It must be a string \(program name\) or list of strings \(name and its args\)." :type '(repeat string) :group 'sha1) @@ -80,20 +79,22 @@ It must be a string \(program name\) or list of strings \(name and its args\)." (defcustom sha1-use-external (condition-case () (executable-find (car sha1-program)) (error)) - "*Use external SHA1 program. + "Use external SHA1 program. If this variable is set to nil, use internal function only." :type 'boolean :group 'sha1) (defun sha1-string-external (string &optional binary) - (let (prog args digest) + (let ((default-directory "/") ;; in case otherwise non-existent + (process-connection-type nil) ;; pipe + prog args digest) (if (consp sha1-program) (setq prog (car sha1-program) args (cdr sha1-program)) (setq prog sha1-program args nil)) (with-temp-buffer - (set-buffer-multibyte nil) + (unless (featurep 'xemacs) (set-buffer-multibyte nil)) (insert string) (apply (function call-process-region) (point-min) (point-max) @@ -437,5 +438,4 @@ If BINARY is non-nil, return a string in binary form." (provide 'sha1) -;; arch-tag: c0f9abd0-ffc1-4557-aac6-ece7f2d4c901 ;;; sha1.el ends here