]> diplodocus.org Git - nmh/commitdiff
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 70377cd643c68065183ae0538cdf3179a4244f68..efa049744a47e364f15ded4797b74bda7f5d4522 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 219d12e93bab56c29d53957aa96a498f958d253f..356e40de945c47539a2c5a927a61ee5c7b448bb4 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 2077c83c200dd1331231190bd1b44e6337f55b64..cbb1859a9423579d1a29ac25eb6d906cafe4eed2 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 58ed5becdcedc021e7775d36878f1d093129640a..ed1b8223e5405550756ec8c4aee09b935717e08c 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);