From a23c91026d542709fa28163e9072be191ff44157 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 25 Nov 2006 11:13:05 +0100 Subject: [PATCH] * src/remove.c (rm): Move cycle_check_init call into callee... Use an else clause in place of a "continue" statement. Signed-off-by: Paul Eggert --- ChangeLog | 3 +++ src/remove.c | 13 +++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6596156..5152963 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,9 @@ (AD_ensure_initialized): New function. (AD_mark_helper): Use it, to avoid the need for declaration after statement. + (rm): Move cycle_check_init call into callee... + (rm_1): ...here. + Use an else clause in place of a "continue" statement. 2006-11-25 Jim Meyering diff --git a/src/remove.c b/src/remove.c index f6fee66..06d2f82 100644 --- a/src/remove.c +++ b/src/remove.c @@ -1479,6 +1479,7 @@ rm_1 (Dirstack_state *ds, char const *filename, struct stat st; cache_stat_init (&st); + cycle_check_init (&ds->cycle_check_state); if (x->root_dev_ino) { if (cache_fstatat (AT_FDCWD, filename, &st, AT_SYMLINK_NOFOLLOW) != 0) @@ -1532,13 +1533,13 @@ rm (size_t n_files, char const *const *file, struct rm_options const *x) { error (0, 0, _("cannot remove relative-named %s"), quote (file[i])); status = RM_ERROR; - continue; } - - cycle_check_init (&ds->cycle_check_state); - enum RM_status s = rm_1 (ds, file[i], x, &cwd_errno); - assert (VALID_STATUS (s)); - UPDATE_STATUS (status, s); + else + { + enum RM_status s = rm_1 (ds, file[i], x, &cwd_errno); + assert (VALID_STATUS (s)); + UPDATE_STATUS (status, s); + } } if (x->require_restore_cwd && cwd_errno) -- 2.7.4