From a8c32ea5a1a64cfc0983402b2ff6a600915fc38b Mon Sep 17 00:00:00 2001 From: Andreas Schulz Date: Sun, 28 Aug 1994 18:34:50 +0000 Subject: [PATCH] Reviewed by: Submitted by: Added the FTS_NOCHDIR flag to the fts-open call. This is needed, so that the fts don't change the current directory for rm and subsequent calls to rmdir with relative pathnames don't fail. Pulled over the bugfix in 1.1.5. --- bin/rm/rm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/rm/rm.c b/bin/rm/rm.c index 4cdf055d4bae..08016fd78b09 100644 --- a/bin/rm/rm.c +++ b/bin/rm/rm.c @@ -141,8 +141,8 @@ rm_tree(argv) #define SKIPPED 1 if (!(fts = fts_open(argv, - needstat ? FTS_PHYSICAL : FTS_PHYSICAL|FTS_NOSTAT, - (int (*)())NULL))) + needstat ? FTS_PHYSICAL|FTS_NOCHDIR : + FTS_PHYSICAL|FTS_NOSTAT|FTS_NOCHDIR, (int (*)())NULL))) err(1, NULL); while ((p = fts_read(fts)) != NULL) { switch (p->fts_info) {