rm: fix the new --dir (-d) option to work with -i
authorRob Day <robertkday@gmail.com>
Wed, 22 Aug 2012 22:04:19 +0000 (23:04 +0100)
committerJim Meyering <meyering@redhat.com>
Thu, 23 Aug 2012 18:53:04 +0000 (20:53 +0200)
commitdd22da8e9539cc88193987b6997769ae4ede2b15
tree630d3469f4d7710c3252682a51f495eba1846924
parentfadf9c525787f063e6fe84bdd5566e53a622c1ce
rm: fix the new --dir (-d) option to work with -i

* src/remove.c (prompt): Hoist the computation of is_empty, since we'll
need it slightly earlier.
Before, this function would arrange to fail with EISDIR when processing
a directory without --recursive (-r).  Adjust the condition to exempt
an empty directory when --dir has been specified.
Improve comments.
* tests/rm/d-3: New file, to ensure that rm -d -i dir works.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention it.
* THANKS.in: Update.
Reported by Michael Price in http://bugs.gnu.org/12260
NEWS
THANKS.in
src/remove.c
tests/Makefile.am
tests/rm/d-3 [new file with mode: 0755]