summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorStephen Berman <stephen.berman@gmx.net>2026-04-17 19:26:37 +0200
committerStephen Berman <stephen.berman@gmx.net>2026-04-17 19:26:37 +0200
commitabde2d1ed3bbd5cf89fede83664ec3424527819c (patch)
tree0c73fe533eb174e6793b537c89db9517784c7bff /test
parentc92354d19023537fe77b7b16773e613e3d4d31c4 (diff)
Restrict Dired handling of newlines in file names
* lisp/dired.el (dired--ls-accept-b-switch-p): New function. (dired-internal-noselect): Use it in the condition on displaying warning about filenames with newlines. (dired--set-auto-toggle-b-switch): Use it to conditionalize calling 'dired--toggle-b-switch'. (dired-auto-toggle-b-switch, dired--toggle-b-switch): Improve doc string. * test/lisp/dired-tests.el (dired-test-filename-with-newline-1) (dired-test-filename-with-newline-2): Skip unless Dired uses an 'ls' that supports the '-b' switch. * etc/NEWS: Adjust accordingly the announcements of the Dired warning and the new user option for file names with newlines.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/dired-tests.el2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el
index f5f92fd6485..b2e0f257a15 100644
--- a/test/lisp/dired-tests.el
+++ b/test/lisp/dired-tests.el
@@ -663,6 +663,7 @@ The current directory at call time should not affect the result (Bug#50630)."
;; File names with embedded newlines are not allowed on MS-Windows and
;; MS-DOS.
(skip-when (memq system-type '(windows-nt ms-dos)))
+ (skip-unless (dired--ls-accept-b-switch-p))
(with-current-buffer "*Messages*"
(let ((inhibit-read-only t))
(erase-buffer)))
@@ -698,6 +699,7 @@ The current directory at call time should not affect the result (Bug#50630)."
;; File names with embedded newlines are not allowed on MS-Windows and
;; MS-DOS.
(skip-when (memq system-type '(windows-nt ms-dos)))
+ (skip-unless (dired--ls-accept-b-switch-p))
(with-current-buffer "*Messages*"
(let ((inhibit-read-only t))
(erase-buffer)))