emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 9ae0e4a: (archive-rar-summarize): Adjust parsing to


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 9ae0e4a: (archive-rar-summarize): Adjust parsing to be more permissive
Date: Sun, 21 Jan 2018 15:42:09 -0500 (EST)

branch: master
commit 9ae0e4aa1aee3d7ff2546e34aa83536f72f8c06a
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    (archive-rar-summarize): Adjust parsing to be more permissive
    
    * lisp/arc-mode.el (archive-rar-summarize): Adjust parsing to
    be more permissive.
    
    The previous code would stop parsing if we had a directory entry or a
    negative ratio as seen from the output of lsar on Debian jessie:
    
      0. D----    16221659  -----  Nr20  2005-12-24 19:30  foo/
      4. -----      466509  -0.0%  Nr20  2005-12-24 19:19  foo/bar.jpg
---
 lisp/arc-mode.el | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index 3973e97..adb3669 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -2043,13 +2043,13 @@ This doesn't recover lost files, it just undoes changes 
in the buffer itself."
       (if copy (delete-file copy))
       (goto-char (point-min))
       (re-search-forward "^\\(\s+=+\s?+\\)+\n")
-      (while (looking-at (concat "^\s+[0-9.]+\s+-+\s+"   ; Flags
-                                 "\\([0-9-]+\\)\s+"      ; Size
-                                 "\\([0-9.%]+\\)\s+"     ; Ratio
-                                 "\\([0-9a-zA-Z]+\\)\s+" ; Mode
-                                 "\\([0-9-]+\\)\s+"      ; Date
-                                 "\\([0-9:]+\\)\s+"      ; Time
-                                 "\\(.*\\)\n"            ; Name
+      (while (looking-at (concat "^\s+[0-9.]+\s+D?-+\s+"   ; Flags
+                                 "\\([0-9-]+\\)\s+"        ; Size
+                                 "\\([-0-9.%]+\\|-+\\)\s+" ; Ratio
+                                 "\\([0-9a-zA-Z]+\\)\s+"   ; Mode
+                                 "\\([0-9-]+\\)\s+"        ; Date
+                                 "\\([0-9:]+\\)\s+"        ; Time
+                                 "\\(.*\\)\n"              ; Name
                                  ))
         (goto-char (match-end 0))
         (let ((name (match-string 6))



reply via email to

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