summaryrefslogtreecommitdiff
path: root/src/rm.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-12-29 21:04:26 +0000
committerJim Meyering <jim@meyering.net>1997-12-29 21:04:26 +0000
commit5cc8090de237d5c765b7096278c9af3eb6089de1 (patch)
tree205d540521fc6d5ed62fa15dcbb3fb19d1f865a0 /src/rm.c
parente2ed51f99ebba522607ae4bbac83caf5dadbbd00 (diff)
downloadcoreutils-5cc8090de237d5c765b7096278c9af3eb6089de1.tar.xz
(remove_cwd_entries): Plug a gross leak -- don't call
obstack_init inside the loop.
Diffstat (limited to 'src/rm.c')
-rw-r--r--src/rm.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/rm.c b/src/rm.c
index 476a0ab3e..2da31aeb8 100644
--- a/src/rm.c
+++ b/src/rm.c
@@ -533,6 +533,8 @@ remove_cwd_entries (void)
enum RM_status status = RM_OK;
+ obstack_init (&entry_name_pool);
+
if (dirp)
{
if (CLOSEDIR (dirp))
@@ -567,8 +569,6 @@ remove_cwd_entries (void)
enum RM_status tmp_status;
struct dirent *dp;
- obstack_init (&entry_name_pool);
-
/* FILE should be skipped if it is `.' or `..', or if it is in
the table, HT, of entries we've already processed. */
#define SKIPPABLE(Ht, File) (DOT_OR_DOTDOT(File) \
@@ -593,8 +593,7 @@ remove_cwd_entries (void)
dp = readdir (dirp);
-/* FIXME: add autoconf test to detect this. */
-#ifndef HAVE_WORKING_READDIR
+#if ! HAVE_WORKING_READDIR
if (dp == NULL)
{
/* Since we have probably modified the directory since it