Cygwin: utils: chattr: fix recursive behaviour

chattr [mode] dir

incorrectly recurses one level into the given directory, even if the
--recursive option has not been used.  This patch adds a test to avoid
this bug.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2021-05-20 22:32:34 +02:00
parent cb674a4ad1
commit f8eecf22db
1 changed files with 1 additions and 1 deletions

View File

@ -347,7 +347,7 @@ next:
{
if (chattr (argv[optind]))
ret = 1;
if (S_ISDIR (st.st_mode) && chattr_dir (argv[optind]))
if (S_ISDIR (st.st_mode) && Ropt && chattr_dir (argv[optind]))
ret = 1;
}
}