From 86e9b55e2984ce54ed9bc99ebfc603e05ab8c2e8 Mon Sep 17 00:00:00 2001 From: David Levine Date: Sun, 11 Mar 2012 19:52:38 -0500 Subject: [PATCH] Fixed mhstore to honor nmh-storage profile entry even with -auto [Bug #35303]. --- docs/pending-release-notes | 3 +++ man/mhstore.man | 4 +++- test/mhstore/test-mhstore | 32 ++++++++++++++++++++++++++++++++ uip/mhstoresbr.c | 4 +--- 4 files changed, 39 insertions(+), 4 deletions(-) diff --git a/docs/pending-release-notes b/docs/pending-release-notes index 70377cd..efa0497 100644 --- a/docs/pending-release-notes +++ b/docs/pending-release-notes @@ -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]. +- Fixed file descriptor leaks in mhparse [Bug #24004: (debbug 344182)]. +- Fixed mhstore to honor nmh-storage profile entry even with -auto + [Bug #35303]. diff --git a/man/mhstore.man b/man/mhstore.man index 219d12e..356e40d 100644 --- a/man/mhstore.man +++ b/man/mhstore.man @@ -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 -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 diff --git a/test/mhstore/test-mhstore b/test/mhstore/test-mhstore index 2077c83..cbb1859 100755 --- a/test/mhstore/test-mhstore +++ b/test/mhstore/test-mhstore @@ -239,5 +239,37 @@ EOF 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 < $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 diff --git a/uip/mhstoresbr.c b/uip/mhstoresbr.c index 58ed5be..ed1b822 100644 --- a/uip/mhstoresbr.c +++ b/uip/mhstoresbr.c @@ -92,9 +92,7 @@ store_all_messages (CT *cts) * 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); -- 1.7.10.4