# HG changeset patch # User Richard M. Stallman # Date 831187837 0 # Node ID bc35b62c3798e57ee493f9b93080a83c78b37d7a # Parent b22de331ee43d06ca98fbca7a66acb059adeb892 (dired-handle-overwrite): `find-backup-file-name' may return nil, so handle that. diff -r b22de331ee43 -r bc35b62c3798 lisp/dired-aux.el --- a/lisp/dired-aux.el Sat May 04 00:50:49 1996 +0000 +++ b/lisp/dired-aux.el Sat May 04 05:30:37 1996 +0000 @@ -925,14 +925,16 @@ ;; Save old version of a to be overwritten file TO. ;; `dired-overwrite-confirmed' and `overwrite-backup-query' are fluid vars ;; from dired-create-files. - (if (and dired-backup-overwrite - dired-overwrite-confirmed - (or (eq 'always dired-backup-overwrite) - (dired-query 'overwrite-backup-query - (format "Make backup for existing file `%s'? " to)))) - (let ((backup (car (find-backup-file-name to)))) - (rename-file to backup 0) ; confirm overwrite of old backup - (dired-relist-entry backup)))) + (let (backup) + (if (and dired-backup-overwrite + dired-overwrite-confirmed + (setq backup (car (find-backup-file-name to))) + (or (eq 'always dired-backup-overwrite) + (dired-query 'overwrite-backup-query + (format "Make backup for existing file `%s'? " to)))) + (progn + (rename-file to backup 0) ; confirm overwrite of old backup + (dired-relist-entry backup))))) ;;;###autoload (defun dired-copy-file (from to ok-flag)