SHARE
TWEET

Johan Sundström

a guest Jan 9th, 2011 653 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --- /Applications/Emacs.app/Contents/Resources/lisp/arc-mode.el 2011-01-09 00:14:24.000000000 -0800
  2. +++ crx-arc-mode.el     2011-01-09 00:20:00.000000000 -0800
  3. @@ -694,6 +694,7 @@
  4.    ;; as an archive by other software.
  5.    (let (case-fold-search)
  6.      (cond ((looking-at "[P]K\003\004") 'zip)
  7. +         ((looking-at "Cr24") 'zip)
  8.           ((looking-at "..-l[hz][0-9ds]-") 'lzh)
  9.           ((looking-at "....................[\334]\247\304\375") 'zoo)
  10.           ((and (looking-at "\C-z")     ; signature too simple, IMHO
  11. @@ -1021,7 +1022,7 @@
  12.    (apply 'call-process
  13.          (car command)
  14.          nil
  15. -        t
  16. +        '(t nil) ;;; stdout to current buffer, stderr to /dev/null
  17.          nil
  18.          (append (cdr command) (list archive name))))
  19.  
  20. @@ -1659,7 +1660,17 @@
  21.  (defun archive-zip-summarize ()
  22.    (goto-char (- (point-max) (- 22 18)))
  23.    (search-backward-regexp "[P]K\005\006")
  24. -  (let ((p (+ (point-min) (archive-l-e (+ (point) 16) 4)))
  25. +  ;;; Google Chrome Extensions prepend a 16 bytes + pubkey + signature header to
  26. +  ;;; an otherwise zip:y file: http://code.google.com/chrome/extensions/crx.html
  27. +  (let ((p (+ (point-min)
  28. +              ;;; if a Google Chrome extension, add its leading header block:
  29. +              (if (string-equal "Cr24" (buffer-substring (point-min)
  30. +                                                         (+ (point-min) 4)))
  31. +                  (+ 16                                  ;;; Chrome header
  32. +                     (archive-l-e (+ (point-min) 8) 4)   ;;; pubkey length
  33. +                     (archive-l-e (+ (point-min) 12) 4)) ;;; signature length
  34. +                0) ; no -- not a Google Chrome extension
  35. +              (archive-l-e (+ (point) 16) 4)))
  36.          (maxlen 8)
  37.         (totalsize 0)
  38.          files
RAW Paste Data
Top