diff options
Diffstat (limited to 'e2fsprogs')
-rw-r--r-- | e2fsprogs/blkid/devname.c | 4 | ||||
-rw-r--r-- | e2fsprogs/chattr.c | 7 | ||||
-rw-r--r-- | e2fsprogs/ext2fs/ismounted.c | 2 | ||||
-rw-r--r-- | e2fsprogs/fsck.c | 4 |
4 files changed, 9 insertions, 8 deletions
diff --git a/e2fsprogs/blkid/devname.c b/e2fsprogs/blkid/devname.c index d69000be7..3d11734d5 100644 --- a/e2fsprogs/blkid/devname.c +++ b/e2fsprogs/blkid/devname.c @@ -189,7 +189,7 @@ static void lvm_probe_all(blkid_cache cache) struct dirent *lv_iter; vg_name = vg_iter->d_name; - if (!strcmp(vg_name, ".") || !strcmp(vg_name, "..")) + if (LONE_CHAR(vg_name, '.') || !strcmp(vg_name, "..")) continue; vdirname = xmalloc(vg_len + strlen(vg_name) + 8); sprintf(vdirname, "%s/%s/LVs", VG_DIR, vg_name); @@ -203,7 +203,7 @@ static void lvm_probe_all(blkid_cache cache) char *lv_name, *lvm_device; lv_name = lv_iter->d_name; - if (!strcmp(lv_name, ".") || !strcmp(lv_name, "..")) + if (LONE_CHAR(lv_name, '.') || !strcmp(lv_name, "..")) continue; lvm_device = xmalloc(vg_len + strlen(vg_name) + 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); diff --git a/e2fsprogs/ext2fs/ismounted.c b/e2fsprogs/ext2fs/ismounted.c index cace7715c..d943f1185 100644 --- a/e2fsprogs/ext2fs/ismounted.c +++ b/e2fsprogs/ext2fs/ismounted.c @@ -144,7 +144,7 @@ static errcode_t check_mntent_file(const char *mtab_file, const char *file, * read/write, since if the root is mounted read/only, the * contents of /etc/mtab may not be accurate. */ - if (!strcmp(mnt->mnt_dir, "/")) { + if (LONE_CHAR(mnt->mnt_dir, '/')) { is_root: #define TEST_FILE "/.ismount-test-file" *mount_flags |= EXT2_MF_ISROOT; diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c index 3b01c1021..da66250f1 100644 --- a/e2fsprogs/fsck.c +++ b/e2fsprogs/fsck.c @@ -1080,7 +1080,7 @@ static int check_all(void) */ if (!parallel_root) { for (fs = filesys_info; fs; fs = fs->next) { - if (!strcmp(fs->mountpt, "/")) + if (LONE_CHAR(fs->mountpt, '/')) break; } if (fs) { @@ -1099,7 +1099,7 @@ static int check_all(void) */ if (skip_root) for (fs = filesys_info; fs; fs = fs->next) - if (!strcmp(fs->mountpt, "/")) + if (LONE_CHAR(fs->mountpt, '/')) fs->flags |= FLAG_DONE; while (not_done_yet) { |