]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/proced.el (proced-<): Check, that NUM1 and NUM2 are numbers.
authorMichael Albinus <michael.albinus@gmx.de>
Fri, 28 Feb 2025 14:32:35 +0000 (15:32 +0100)
committerEshel Yaron <me@eshelyaron.com>
Tue, 4 Mar 2025 20:51:31 +0000 (21:51 +0100)
(Bug#76549)

(cherry picked from commit 5247da2e3cd2705278bb68e0c5313a6972a6d43c)

lisp/proced.el

index 600188282fcdde12a3ff0f6a8419038f8f25aba2..96466a64f30f1bb374e71518fc9df76e5e12828f 100644 (file)
@@ -1423,10 +1423,12 @@ a certain refinement, consider defining a new filter in `proced-filter-alist'."
 
 (defun proced-< (num1 num2)
   "Return t if NUM1 less than NUM2.
-Return `equal' if NUM1 equals NUM2.  Return nil if NUM1 greater than NUM2."
-  (if (= num1 num2)
-      'equal
-    (< num1 num2)))
+Return `equal' if NUM1 equals NUM2.  Return nil if NUM1 greater than NUM2.
+If either NUM1 or NUM2 is not a number, return nil."
+  (when (and (numberp num1) (numberp num2))
+    (if (= num1 num2)
+        'equal
+      (< num1 num2))))
 
 (defun proced-string-lessp (s1 s2)
   "Return t if string S1 is less than S2 in lexicographic order.