change the interface of libbb/compare_string_array (unsigned short to int), usaging...
author"Vladimir N. Oleynik" <dzo@simtreas.ru>
Sat, 26 Nov 2005 10:45:26 +0000 (10:45 -0000)
committer"Vladimir N. Oleynik" <dzo@simtreas.ru>
Sat, 26 Nov 2005 10:45:26 +0000 (10:45 -0000)
e2fsprogs/fsck.c
include/libbb.h
libbb/compare_string_array.c

index ae4e3d0c8f750ff2656da59affdefbc112ff7e98..7f7ab3eb32edc2330bc5bcb4a3cb62ae67f65483 100644 (file)
@@ -1006,11 +1006,11 @@ static int ignore(struct fs_info *fs)
        if (!fs_match(fs, &fs_type_compiled)) return 1;
 
        /* Are we ignoring this type? */
-       if(compare_string_array(ignored_types, fs->type))
+       if(compare_string_array(ignored_types, fs->type) >= 0)
                return 1;
 
        /* Do we really really want to check this fs? */
-       wanted = compare_string_array(really_wanted, fs->type);
+       wanted = compare_string_array(really_wanted, fs->type) >= 0;
 
        /* See if the <fsck.fs> program is available. */
        s = find_fsck(fs->type);
index 70a9336d88e565f54b6ad500e0028ea4c07f8350..d1c6be670c20bbf7b4c5ed10edac2a49101dec03 100644 (file)
@@ -466,7 +466,7 @@ typedef struct {
 } procps_status_t;
 
 extern procps_status_t * procps_scan(int save_user_arg0);
-extern unsigned short compare_string_array(const char * const string_array[], const char *key);
+extern int compare_string_array(const char * const string_array[], const char *key);
 
 extern int my_query_module(const char *name, int which, void **buf, size_t *bufsize, size_t *ret);
 
index 8961e003e5569279ac8924aa7e7d8f16ed3951f9..fc077b309e81ed4d9005ed52bd1a900543b4511c 100644 (file)
 #include <string.h>
 
 /* returns the array number of the string */
-extern unsigned shor
+extern in
 compare_string_array(const char * const string_array[], const char *key)
 {
-       unsigned short i;
+       int i;
 
        for (i = 0; string_array[i] != 0; i++) {
                if (strcmp(string_array[i], key) == 0) {
-                       break;
+                       return i;
                }
        }
-       return(i);
+       return -i;
 }