]> git.eshelyaron.com Git - emacs.git/commitdiff
gamegrid-add-score-with-update-game-score fix
authorGlenn Morris <rgm@gnu.org>
Tue, 5 Feb 2013 02:03:51 +0000 (21:03 -0500)
committerGlenn Morris <rgm@gnu.org>
Tue, 5 Feb 2013 02:03:51 +0000 (21:03 -0500)
* lisp/play/gamegrid.el (gamegrid-add-score-with-update-game-score):
Fix directory creation in fallback case.

lisp/ChangeLog
lisp/play/gamegrid.el

index 671bd6bdf3fa58ba312c031f65bda1251de8dec3..eff5eadb614e8323d90a0a6c8f6ae112478b7972 100644 (file)
@@ -1,3 +1,8 @@
+2013-02-05  Glenn Morris  <rgm@gnu.org>
+
+       * play/gamegrid.el (gamegrid-add-score-with-update-game-score):
+       Fix directory creation in fallback case.
+
 2013-02-04  Thierry Volpiatto  <thierry.volpiatto@gmail.com>
 
        * vc/vc.el (vc-next-action): Fix inf-loop (bug#13610).
index eefe1e22599697afc357509bcdacb8f7390efda2..91192517f7c47bfab686e3fb46a5e8850faa6c88 100644 (file)
@@ -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)