diff options
author | Denis Vlasenko | 2006-12-21 13:23:14 +0000 |
---|---|---|
committer | Denis Vlasenko | 2006-12-21 13:23:14 +0000 |
commit | bf66fbc8e2380717c1fab860cfc60c78582839dd (patch) | |
tree | 3ab3dd4df901851ff7f4345708592118766ba4aa /e2fsprogs/chattr.c | |
parent | 6910741067913d131d931b1e6424d3b8ed43e64f (diff) | |
download | busybox-bf66fbc8e2380717c1fab860cfc60c78582839dd.zip busybox-bf66fbc8e2380717c1fab860cfc60c78582839dd.tar.gz |
introduce LONE_CHAR (optimized strcmp with one-char string)
Diffstat (limited to 'e2fsprogs/chattr.c')
-rw-r--r-- | e2fsprogs/chattr.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/e2fsprogs/chattr.c b/e2fsprogs/chattr.c index 4c34162..4848e1e 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); |