]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix 'find-ls-option-default-ls' for BSD/MacOS (bug#62096)
authorManuel Giraud <manuel@ledu-giraud.fr>
Fri, 10 Mar 2023 20:54:00 +0000 (21:54 +0100)
committerEli Zaretskii <eliz@gnu.org>
Sat, 18 Mar 2023 06:29:17 +0000 (08:29 +0200)
* 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.

lisp/find-dired.el

index 33376ee4ed955ea1c5cbfed9fef1e9eb7fcfb3d0..264c6e3082f5388c3a85339111d9f6d1db7dda5c 100644 (file)
@@ -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"))