Fixed mhstore to honor nmh-storage profile entry even with -auto [Bug #35303].
authorDavid Levine <levinedl@acm.org>
Mon, 12 Mar 2012 00:52:38 +0000 (19:52 -0500)
committerDavid Levine <levinedl@acm.org>
Mon, 12 Mar 2012 00:52:38 +0000 (19:52 -0500)
docs/pending-release-notes
man/mhstore.man
test/mhstore/test-mhstore
uip/mhstoresbr.c

index 70377cd..efa0497 100644 (file)
@@ -43,3 +43,6 @@ Things to add to the release notes for the next full release:
 - A problem with the MD5 digest calculator on 64-bit systems has been fixed.
 - Fixed mhbuild -check to properly insert Content-MD5 header.
 - Fixed mhlist -verbose to work with all content types [Bug #35219].
 - A problem with the MD5 digest calculator on 64-bit systems has been fixed.
 - Fixed mhbuild -check to properly insert Content-MD5 header.
 - Fixed mhlist -verbose to work with all content types [Bug #35219].
+- Fixed file descriptor leaks in mhparse [Bug #24004: (debbug 344182)].
+- Fixed mhstore to honor nmh-storage profile entry even with -auto
+  [Bug #35303].
index 219d12e..356e40d 100644 (file)
@@ -218,7 +218,9 @@ to store the content.  If the formatting string starts with a '/',
 then the content will be stored in the full path given, else the
 file name will be relative to the value of \*(lqnmh-storage\*(rq or
 the current working directory.  Any escapes (given below) will be
 then the content will be stored in the full path given, else the
 file name will be relative to the value of \*(lqnmh-storage\*(rq or
 the current working directory.  Any escapes (given below) will be
-expanded, except for the a-escape.
+expanded, except for the a-escape.  Note that if \*(lqnmh-storage\*(rq
+is not an absolute path, it will be relative to the folder that
+contains the message(s).
 .PP
 A command or pathname formatting string may contain the following
 escapes.  If the content isn't part of a multipart (of any subtype
 .PP
 A command or pathname formatting string may contain the following
 escapes.  If the content isn't part of a multipart (of any subtype
index 2077c83..cbb1859 100755 (executable)
@@ -239,5 +239,37 @@ EOF
 run_test 'mhstore last' 'storing message 15 as file 15.txt'
 check $expected 15.txt
 
 run_test 'mhstore last' 'storing message 15 as file 15.txt'
 check $expected 15.txt
 
+# check with relative nmh-storage profile component
+storagedir=storagedir
+dir="$MH_TEST_DIR/Mail/inbox/$storagedir"
+mkdir "$dir"
+echo "nmh-storage: $storagedir" >> $MH
+cat > $expected <<EOF
+This is the fourth text/plain part.
+EOF
+run_test 'mhstore 11 -part 4' \
+"storing message 11 part 4 as file $storagedir/11.4.txt"
+check $expected "$dir/11.4.txt" 'keep first'
+
+# check with relative nmh-storage profile component and -auto
+run_test 'mhstore 11 -part 4 -auto' \
+"storing message 11 part 4 as file $storagedir/test4.txt"
+check $expected "$dir/test4.txt" 'keep first'
+
+# check with absolute nmh-storage profile component
+absstoragedir="$MH_TEST_DIR/$storagedir"
+mkdir "$absstoragedir"
+sed "s%\(nmh-storage: \)storagedir%\1$absstoragedir%" $MH > $MH.new
+mv -f $MH.new $MH
+run_test 'mhstore 11 -part 4' \
+"storing message 11 part 4 as file $storagedir/11.4.txt"
+check $expected "$absstoragedir/11.4.txt" 'keep first'
+
+# check with absolute nmh-storage profile component and -auto
+run_test 'mhstore 11 -part 4 -auto' \
+"storing message 11 part 4 as file $storagedir/test4.txt"
+check $expected "$absstoragedir/test4.txt"
+rmdir "$absstoragedir"
+
 
 exit $failed
 
 exit $failed
index 58ed5be..ed1b822 100644 (file)
@@ -92,9 +92,7 @@ store_all_messages (CT *cts)
      * Check for the directory in which to
      * store any contents.
      */
      * Check for the directory in which to
      * store any contents.
      */
-    if (autosw)
-       dir = getcpy (cwd);
-    else if ((cp = context_find (nmhstorage)) && *cp)
+    if ((cp = context_find (nmhstorage)) && *cp)
        dir = getcpy (cp);
     else
        dir = getcpy (cwd);
        dir = getcpy (cp);
     else
        dir = getcpy (cwd);