aboutsummaryrefslogtreecommitdiff
path: root/e2fsprogs/chattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'e2fsprogs/chattr.c')
-rw-r--r--e2fsprogs/chattr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/e2fsprogs/chattr.c b/e2fsprogs/chattr.c
index 4c341627e..4848e1e1a 100644
--- a/e2fsprogs/chattr.c
+++ b/e2fsprogs/chattr.c
@@ -157,9 +157,10 @@ skip_setflags:
static int chattr_dir_proc(const char *dir_name, struct dirent *de,
void *private EXT2FS_ATTR((unused)))
{
- /*if (strcmp(de->d_name, ".") && strcmp(de->d_name, "..")) {*/
- if (de->d_name[0] == '.' && (de->d_name[1] == '\0' || \
- (de->d_name[1] == '.' && de->d_name[2] == '\0'))) {
+ /*if (strcmp(de->d_name, ".") || strcmp(de->d_name, "..")) {*/
+ if (de->d_name[0] == '.'
+ && (!de->d_name[1] || (de->d_name[1] == '.' && !de->d_name[2]))
+ ) {
char *path = concat_subpath_file(dir_name, de->d_name);
if (path) {
change_attributes(path);