From 61ff4b39738085d1b88d934f619b840fd296c8a8 Mon Sep 17 00:00:00 2001 From: "Vladimir N. Oleynik" Date: Sat, 26 Nov 2005 10:33:55 +0000 Subject: more use const for interface of libbb/compare_string_array, example usage for e2fsprogs/fsck --- e2fsprogs/fsck.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'e2fsprogs') diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c index b7e25d6..ae4e3d0 100644 --- a/e2fsprogs/fsck.c +++ b/e2fsprogs/fsck.c @@ -988,8 +988,7 @@ static int fs_match(struct fs_info *fs, struct fs_type_compile *cmp) /* Check if we should ignore this filesystem. */ static int ignore(struct fs_info *fs) { - const char * const *ip; - int wanted = 0; + int wanted; char *s; /* @@ -1007,15 +1006,11 @@ static int ignore(struct fs_info *fs) if (!fs_match(fs, &fs_type_compiled)) return 1; /* Are we ignoring this type? */ - for(ip = ignored_types; *ip; ip++) - if (strcmp(fs->type, *ip) == 0) return 1; + if(compare_string_array(ignored_types, fs->type)) + return 1; /* Do we really really want to check this fs? */ - for(ip = really_wanted; *ip; ip++) - if (strcmp(fs->type, *ip) == 0) { - wanted = 1; - break; - } + wanted = compare_string_array(really_wanted, fs->type); /* See if the program is available. */ s = find_fsck(fs->type); -- cgit v1.1