From: Lars Ingebrigtsen Date: Tue, 22 Sep 2020 15:32:51 +0000 (+0200) Subject: Ensure that the game directory exists before trying to write to it X-Git-Tag: emacs-28.0.90~5930 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=44bb59f79e7ea7928b12a1f3eb8b5ada0265c1d0;p=emacs.git Ensure that the game directory exists before trying to write to it * lisp/play/gamegrid.el (gamegrid-add-score-insecure): Make the directory if it doesn't exist (bug#37836). --- diff --git a/lisp/play/gamegrid.el b/lisp/play/gamegrid.el index 9b74eb913e0..74e6c2d034d 100644 --- a/lisp/play/gamegrid.el +++ b/lisp/play/gamegrid.el @@ -635,6 +635,8 @@ FILE is created there." (save-excursion (setq file (expand-file-name file (or directory temporary-file-directory))) + (unless (file-exists-p (file-name-directory file)) + (make-directory (file-name-directory file) t)) (find-file-other-window file) (setq buffer-read-only nil) (goto-char (point-max))