diff options
| author | Katsumi Yamaoka | 2014-07-22 06:37:31 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2014-07-22 06:37:31 +0000 |
| commit | c448c6241fd6cef424447dbfeaee18240aece27a (patch) | |
| tree | a27a4f563b7d576105f5c06c3695c5f7e717293a | |
| parent | da8b9ab0d89e7724e7d7ee9468d6f1e83ab6a053 (diff) | |
| download | emacs-c448c6241fd6cef424447dbfeaee18240aece27a.tar.gz emacs-c448c6241fd6cef424447dbfeaee18240aece27a.zip | |
gnus-utils.el (gnus-recursive-directory-files): Unify hard or symbolic links (bug#18063)
| -rw-r--r-- | lisp/gnus/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/gnus/gnus-util.el | 28 |
2 files changed, 23 insertions, 10 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index cdfe4f4dea8..f55e04f02e6 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-07-22 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2 | |||
| 3 | * gnus-utils.el (gnus-recursive-directory-files): | ||
| 4 | Unify hard or symbolic links (bug#18063). | ||
| 5 | |||
| 1 | 2013-07-17 Albert Krewinkel <albert@zeitkraut.de> | 6 | 2013-07-17 Albert Krewinkel <albert@zeitkraut.de> |
| 2 | 7 | ||
| 3 | * gnus-msg.el (gnus-configure-posting-style): | 8 | * gnus-msg.el (gnus-configure-posting-style): |
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 62977576a00..fe4d707be2e 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el | |||
| @@ -1910,17 +1910,25 @@ Sizes are in pixels." | |||
| 1910 | image))) | 1910 | image))) |
| 1911 | image))) | 1911 | image))) |
| 1912 | 1912 | ||
| 1913 | (eval-when-compile (require 'gmm-utils)) | ||
| 1913 | (defun gnus-recursive-directory-files (dir) | 1914 | (defun gnus-recursive-directory-files (dir) |
| 1914 | "Return all regular files below DIR." | 1915 | "Return all regular files below DIR. |
| 1915 | (let (files) | 1916 | The first found will be returned if a file has hard or symbolic links." |
| 1916 | (dolist (file (directory-files dir t)) | 1917 | (let (files attr attrs) |
| 1917 | (when (and (not (member (file-name-nondirectory file) '("." ".."))) | 1918 | (gmm-labels |
| 1918 | (file-readable-p file)) | 1919 | ((fn (directory) |
| 1919 | (cond | 1920 | (dolist (file (directory-files directory t)) |
| 1920 | ((file-regular-p file) | 1921 | (setq attr (file-attributes (file-truename file))) |
| 1921 | (push file files)) | 1922 | (when (and (not (member attr attrs)) |
| 1922 | ((file-directory-p file) | 1923 | (not (member (file-name-nondirectory file) |
| 1923 | (setq files (append (gnus-recursive-directory-files file) files)))))) | 1924 | '("." ".."))) |
| 1925 | (file-readable-p file)) | ||
| 1926 | (push attr attrs) | ||
| 1927 | (cond ((file-regular-p file) | ||
| 1928 | (push file files)) | ||
| 1929 | ((file-directory-p file) | ||
| 1930 | (fn file))))))) | ||
| 1931 | (fn dir)) | ||
| 1924 | files)) | 1932 | files)) |
| 1925 | 1933 | ||
| 1926 | (defun gnus-list-memq-of-list (elements list) | 1934 | (defun gnus-list-memq-of-list (elements list) |