diff options
author | Manuel Giraud <manuel@ledu-giraud.fr> | 2023-03-10 21:54:00 +0100 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2023-03-18 08:29:17 +0200 |
commit | ec6a73e0d3206255fe422cd248d6be959f50aec9 (patch) | |
tree | d8b38868763835d6d99e6274f1b32f31cde00cad /lisp/find-dired.el | |
parent | 891a37ab36a0782a798841c056a2dd86bd31161a (diff) | |
download | emacs-ec6a73e0d3206255fe422cd248d6be959f50aec9.tar.gz |
Fix 'find-ls-option-default-ls' for BSD/MacOS (bug#62096)
* lisp/find-dired.el (find-gnu-find-p): New variable to determine
if "find" is a GNU find.
(find-ls-option-default-ls): Use 'find-gnu-find-p' and adapt to a
value that works with the default "find" on *BSD and Darwin/MacOS.
Tested on OpenBSD and MacOS.
Diffstat (limited to 'lisp/find-dired.el')
-rw-r--r-- | lisp/find-dired.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/find-dired.el b/lisp/find-dired.el index 33376ee4ed9..264c6e3082f 100644 --- a/lisp/find-dired.el +++ b/lisp/find-dired.el @@ -50,8 +50,13 @@ than the latter." :group 'find-dired :type 'string) +(defvar find-gnu-find-p + (eq 0 (ignore-errors + (process-file find-program nil nil nil null-device "--version"))) + "T if 'find-program' is a GNU find. NIL otherwise.") + (defvar find-ls-option-default-ls - (cons "-ls" (if (eq system-type 'berkeley-unix) "-gilsb" "-dilsb"))) + (cons "-ls" (if find-gnu-find-p "-dilsb" "-dgils"))) (defvar find-ls-option-default-exec (cons (format "-exec ls -ld {} %s" find-exec-terminator) "-ld")) |