introduce LONE_CHAR (optimized strcmp with one-char string)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user