]> git.eshelyaron.com Git - emacs.git/commitdiff
Use decoded-time accessors in esh-util
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 1 Aug 2019 11:46:28 +0000 (13:46 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 1 Aug 2019 11:48:29 +0000 (13:48 +0200)
* lisp/eshell/esh-util.el (eshell-parse-ange-ls): Use decoded-time
accessors for results from `parse-time-string'.

lisp/eshell/esh-util.el

index 082403130d4140953d6ecc131826cbd25b6dbffb..353b9400f2e0fdb11ba6211e6018a3c2063a0573 100644 (file)
@@ -647,12 +647,12 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
               (name (ange-ftp-parse-filename))
               (mtime
                (let ((moment (parse-time-string (match-string 6))))
-                 (if (nth 0 moment)
-                     (setcar (nthcdr 5 moment)
-                             (decoded-time-year (decode-time)))
-                   (setcar (nthcdr 0 moment) 0)
-                   (setcar (nthcdr 1 moment) 0)
-                   (setcar (nthcdr 2 moment) 0))
+                 (if (decoded-time-second moment)
+                     (setf (decoded-time-year moment)
+                           (decoded-time-year (decode-time)))
+                   (setf (decoded-time-second moment) 0)
+                   (setf (decoded-time-minute moment) 0)
+                    (setf (decoded-time-hour moment) 0))
                  (encode-time moment)))
               symlink)
          (if (string-match "\\(.+\\) -> \\(.+\\)" name)