diff options
| author | Michael Albinus | 2020-03-21 10:30:26 +0100 |
|---|---|---|
| committer | Michael Albinus | 2020-03-21 10:30:26 +0100 |
| commit | 8158337cc254403fbae6fed3d80064400f62f48b (patch) | |
| tree | 14ce35860390df58d60763d5c5b726800755f201 /test | |
| parent | 0a22747c3f17da0e64cbb6d82aab3a14e716f0fd (diff) | |
| download | emacs-8158337cc254403fbae6fed3d80064400f62f48b.tar.gz emacs-8158337cc254403fbae6fed3d80064400f62f48b.zip | |
Fix Bug#40156 in Tramp
* lisp/net/tramp-sh.el (tramp-sh-handle-write-region): Copy to temp file
only if FILENAME exists. (Bug#40156)
* test/lisp/net/tramp-tests.el (tramp-test10-write-region): Extend test.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index e220420d8cf..e6c6b28c58a 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -2356,7 +2356,14 @@ This checks also `file-name-as-directory', `file-name-directory', | |||
| 2356 | (write-region nil nil tmp-name 3)) | 2356 | (write-region nil nil tmp-name 3)) |
| 2357 | (with-temp-buffer | 2357 | (with-temp-buffer |
| 2358 | (insert-file-contents tmp-name) | 2358 | (insert-file-contents tmp-name) |
| 2359 | (should (string-equal (buffer-string) "foobaz")))) | 2359 | (should (string-equal (buffer-string) "foobaz"))) |
| 2360 | (delete-file tmp-name) | ||
| 2361 | (with-temp-buffer | ||
| 2362 | (insert "foo") | ||
| 2363 | (write-region nil nil tmp-name 'append)) | ||
| 2364 | (with-temp-buffer | ||
| 2365 | (insert-file-contents tmp-name) | ||
| 2366 | (should (string-equal (buffer-string) "foo")))) | ||
| 2360 | 2367 | ||
| 2361 | ;; Write string. | 2368 | ;; Write string. |
| 2362 | (write-region "foo" nil tmp-name) | 2369 | (write-region "foo" nil tmp-name) |