aboutsummaryrefslogtreecommitdiff
path: root/e2fsprogs/chattr.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-12-21 13:23:14 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-12-21 13:23:14 +0000
commitbf66fbc8e2380717c1fab860cfc60c78582839dd (patch)
tree3ab3dd4df901851ff7f4345708592118766ba4aa /e2fsprogs/chattr.c
parent6910741067913d131d931b1e6424d3b8ed43e64f (diff)
downloadbusybox-bf66fbc8e2380717c1fab860cfc60c78582839dd.tar.gz
introduce LONE_CHAR (optimized strcmp with one-char string)
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);