From: Glenn Morris Date: Tue, 5 Feb 2013 02:03:51 +0000 (-0500) Subject: gamegrid-add-score-with-update-game-score fix X-Git-Tag: emacs-24.3.90~173^2~7^2~147 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3505fa027b66c06bf5f86a71f291dbbdead9070e;p=emacs.git gamegrid-add-score-with-update-game-score fix * lisp/play/gamegrid.el (gamegrid-add-score-with-update-game-score): Fix directory creation in fallback case. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 671bd6bdf3f..eff5eadb614 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-02-05 Glenn Morris + + * play/gamegrid.el (gamegrid-add-score-with-update-game-score): + Fix directory creation in fallback case. + 2013-02-04 Thierry Volpiatto * vc/vc.el (vc-next-action): Fix inf-loop (bug#13610). diff --git a/lisp/play/gamegrid.el b/lisp/play/gamegrid.el index eefe1e22599..91192517f7c 100644 --- a/lisp/play/gamegrid.el +++ b/lisp/play/gamegrid.el @@ -505,15 +505,13 @@ FILE is created there." (make-directory gamegrid-user-score-file-directory t)) (gamegrid-add-score-insecure file score gamegrid-user-score-file-directory)) - (t (let ((f (expand-file-name - gamegrid-user-score-file-directory))) - (when (file-writable-p f) - (unless (eq (car-safe (file-attributes f)) - t) - (make-directory f)) - (setq f (expand-file-name file f)) + (t + (unless (file-exists-p + (directory-file-name gamegrid-user-score-file-directory)) + (make-directory gamegrid-user-score-file-directory t)) + (let ((f (expand-file-name file gamegrid-user-score-file-directory))) (unless (file-exists-p f) - (write-region "" nil f nil 'silent nil 'excl))) + (write-region "" nil f nil 'silent nil 'excl)) (gamegrid-add-score-with-update-game-score-1 file f score)))))) (defun gamegrid-add-score-with-update-game-score-1 (file target score)