--- mhtxtplain.pl.ORIG	Wed Sep  5 22:04:27 2001
+++ mhtxtplain.pl	Sun Dec 30 14:06:23 2001
@@ -145,10 +145,10 @@
 	# filter to convert text data: makes it easier to handle all
 	# the various formatting options.
 	foreach $pdata
-		(split(/^(begin \d\d\d \S+\n[!-M].*?\nend\n)/sm, $$data)) {
+		(split(/^(begin \d\d\d [\S ]+\r?\n[!-M].*?\nend\r?\n)/sm, $$data)) {
 	    if ($i % 2) {	# uuencoded data
 		# extract filename extension
-		($file) = $pdata =~ /^begin \d\d\d (\S+)/;
+		($file) = $pdata =~ /^begin \d\d\d ([\S ]+)/;
 		if ($file =~ /\.(\w+)$/) { $inext = $1; } else { $inext = ""; }
 
 		# decode data
