emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r106105: * json.el: Bump version to 1


From: Ted Zlatanov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106105: * json.el: Bump version to 1.3; (json-alist-p, json-plist-p): Rewrite to avoid recursion.
Date: Mon, 17 Oct 2011 13:40:27 -0400
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106105
committer: Ted Zlatanov <address@hidden>
branch nick: quickfixes
timestamp: Mon 2011-10-17 13:40:27 -0400
message:
  * json.el: Bump version to 1.3; (json-alist-p, json-plist-p): Rewrite to 
avoid recursion.
modified:
  lisp/ChangeLog
  lisp/json.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-10-17 16:33:23 +0000
+++ b/lisp/ChangeLog    2011-10-17 17:40:27 +0000
@@ -1,3 +1,8 @@
+2011-10-17  Teodor Zlatanov  <address@hidden>
+
+       * json.el: Bump version to 1.3 and note change in History.
+       (json-alist-p, json-plist-p): Rewrite to avoid recursion.
+
 2011-10-17  Stefan Monnier  <address@hidden>
 
        * comint.el (comint-insert-input, comint-send-input)

=== modified file 'lisp/json.el'
--- a/lisp/json.el      2011-01-25 04:08:28 +0000
+++ b/lisp/json.el      2011-10-17 17:40:27 +0000
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2006-2011 Free Software Foundation, Inc.
 
 ;; Author: Edward O'Connor <address@hidden>
-;; Version: 1.2
+;; Version: 1.3
 ;; Keywords: convenience
 
 ;; This file is part of GNU Emacs.
@@ -47,6 +47,7 @@
 ;;              other cleanups, bugfixes, and improvements.
 ;; 2006-12-29 - XEmacs support, from Aidan Kehoe <address@hidden>.
 ;; 2008-02-21 - Installed in GNU Emacs.
+;; 2011-10-17 - Patch `json-alist-p' and `json-plist-p' to avoid recursion -tzz
 
 ;;; Code:
 
@@ -108,16 +109,20 @@
 
 (defun json-alist-p (list)
   "Non-null if and only if LIST is an alist."
-  (or (null list)
-      (and (consp (car list))
-           (json-alist-p (cdr list)))))
+  (while (consp list)
+    (setq list (if (consp (car list))
+                   (cdr list)
+                 'not-alist)))
+  (null list))
 
 (defun json-plist-p (list)
   "Non-null if and only if LIST is a plist."
-  (or (null list)
-      (and (keywordp (car list))
-           (consp (cdr list))
-           (json-plist-p (cddr list)))))
+  (while (consp list)
+    (setq list (if (and (keywordp (car list))
+                        (consp (cdr list)))
+                   (cddr list)
+                 'not-plist)))
+  (null list))
 
 ;; Reader utilities
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]