]> git.eshelyaron.com Git - emacs.git/commitdiff
Ensure that the game directory exists before trying to write to it
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 22 Sep 2020 15:32:51 +0000 (17:32 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 22 Sep 2020 15:32:51 +0000 (17:32 +0200)
* lisp/play/gamegrid.el (gamegrid-add-score-insecure): Make the
directory if it doesn't exist (bug#37836).

lisp/play/gamegrid.el

index 9b74eb913e0e1864a83fa5ff8537e2396da43ef7..74e6c2d034df8d126933dbf4ce81ebdddc7a3e39 100644 (file)
@@ -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))