From 44bb59f79e7ea7928b12a1f3eb8b5ada0265c1d0 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 22 Sep 2020 17:32:51 +0200 Subject: [PATCH] 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). --- lisp/play/gamegrid.el | 2 ++ 1 file changed, 2 insertions(+) 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)) -- 2.39.2