T-gnus 6.14.6; synch up with Gnus v5.8.8.
[elisp/gnus.git-] / lisp / mm-uu.el
index 8a4b323..0029a4a 100644 (file)
@@ -1,5 +1,5 @@
-;;; mm-uu.el -- Return uu stuffs as mm handles
-;; Copyright (c) 1998,99 Free Software Foundation, Inc.
+;;; mm-uu.el -- Return uu stuff as mm handles
+;; Copyright (c) 1998, 1999, 2000 Free Software Foundation, Inc.
 
 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
 ;; Keywords: postscript uudecode binhex shar forward news
 
 ;;; Code:
 
+(eval-when-compile (require 'cl))
 (require 'mail-parse)
-(require 'message)
 (require 'nnheader)
 (require 'mm-decode)
-(require 'mailcap)
+(require 'gnus-mailcap)
 
 (eval-and-compile
   (autoload 'binhex-decode-region "binhex")
@@ -77,7 +77,7 @@ decoder, such as hexbin."
   :group 'gnus-article-mime) 
 
 (defconst mm-uu-shar-begin-line "^#! */bin/sh")
-(defconst mm-uu-shar-end-line "^exit 0\\|^$")
+(defconst mm-uu-shar-end-line "^exit 0")
 
 ;;; Thanks to Edward J. Sabol <sabol@alderaan.gsfc.nasa.gov> and 
 ;;; Peter von der Ah\'e <pahe@daimi.au.dk>
@@ -165,10 +165,16 @@ To disable dissecting shar codes, for instance, add
          (setq end-char-1 (match-beginning 0))
          (forward-line)
          (setq end-char (point))
-         (when (or (not (eq type 'binhex))
-                   (setq file-name
-                         (ignore-errors
-                           (binhex-decode-region start-char end-char t))))
+         (when (cond 
+                ((eq type 'binhex)
+                 (setq file-name
+                       (ignore-errors
+                         (binhex-decode-region start-char end-char t))))
+                ((eq type 'forward)
+                 (save-excursion
+                   (goto-char start-char-1)
+                   (looking-at "[\r\n]*[a-zA-Z][a-zA-Z0-9-]*:")))
+                (t t))
            (if (> start-char text-start)
                (push
                 (mm-make-handle (mm-uu-copy-to-buffer text-start start-char)
@@ -185,7 +191,8 @@ To disable dissecting shar codes, for instance, add
              ((eq type 'uu)
               (mm-make-handle (mm-uu-copy-to-buffer start-char end-char)
                               (list (or (and file-name
-                                             (string-match "\\.[^\\.]+$" file-name)
+                                             (string-match "\\.[^\\.]+$"
+                                                           file-name)
                                              (mailcap-extension-to-mime
                                               (match-string 0 file-name)))
                                         "application/octet-stream"))