]> diplodocus.org Git - nmh/blobdiff - test/mhmail/test-mhmail
Garbage collect some Autoconf cruft that has been around a lot longer
[nmh] / test / mhmail / test-mhmail
index a6a3917633577fbf8cff0bd96a333a56016a9743..df921b6dfac26fea66910601c494680618792ca3 100755 (executable)
@@ -16,18 +16,17 @@ fi
 
 # Find MIME type string, using mimetypeproc if configured with it.
 MIMETYPEPROC=`mhparam mimetypeproc`
 
 # Find MIME type string, using mimetypeproc if configured with it.
 MIMETYPEPROC=`mhparam mimetypeproc`
-file -i * # temporary, for debugging on OpenBSD
 content_type_string() {
 content_type_string() {
-echo $1
-echo $MIMETYPEPROC; $MIMETYPEPROC $1 # temporary, for debugging on OpenBSD
   if test -z "$MIMETYPEPROC"; then
     echo "text/plain; name=\"`basename $1`\"; charset=\"us-ascii\""
   else
     # 1) Excise leading filename followed by : and any whitespace.
   if test -z "$MIMETYPEPROC"; then
     echo "text/plain; name=\"`basename $1`\"; charset=\"us-ascii\""
   else
     # 1) Excise leading filename followed by : and any whitespace.
-    # 2) Wrap charset value in double quotes.  Assume that it isn't already.
+    # 2) Insert semicolon if there isn't one before the first space.
+    #    OpenBSD file --mime spits out things like "text/plain charset=...".
+    # 3) Wrap charset value in double quotes.  Assume that it isn't already.
     printf "%s %s%s" \
     printf "%s %s%s" \
-      `$MIMETYPEPROC $1 | sed -e 's/.*: *//' -e 's/\(charset=\)\(.*\)/\1"\2"/'`\
-      "; name=\"`basename $1`\""
+      `$MIMETYPEPROC $1 | sed -e 's/.*: *//' -e 's/\([^;]\) /\1; /' \
+         -e 's/\(charset=\)\(.*\)/\1"\2"/'` "; name=\"`basename $1`\""
   fi
 }
 
   fi
 }