From 1065d9d38952e07c71f8b76b1bf9f86bdf8d3388 Mon Sep 17 00:00:00 2001 From: Milan Zamazal Date: Wed, 15 Jun 2022 21:03:42 +0200 Subject: [PATCH] Fix pw-cli--parse-properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove some redundancy. - Make sure we don’t search after the end point. - Move to the end point (this is necessary for parsing the following object). --- pw-access.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pw-access.el b/pw-access.el index 1f028c2..3d23175 100644 --- a/pw-access.el +++ b/pw-access.el @@ -153,17 +153,17 @@ Note this interface may not work with all PipeWire versions.") (defun pw-cli--parse-properties () (pw-cli--next-line) - (let ((end (save-excursion - (or (and (re-search-forward "^ Object:" nil t) - (point)) - (point-max)))) + (let ((end (or (save-excursion (re-search-forward "^ Object:" nil t)) + (point-max))) (properties '())) - (while (re-search-forward "^ Prop: key \\([A-Za-z:]+\\)" end t) + (while (and (< (point) end) + (re-search-forward "^ Prop: key \\([A-Za-z:]+\\)" end t)) (pw-cli--next-line) (let ((property (car (last (split-string (match-string 1) ":")))) (value (pw-cli--read-property))) (when value (push (cons property value) properties)))) + (goto-char end) properties)) (cl-defmethod pw-access-properties ((_class pw-cli-accessor) node-id)