Ignore:
Timestamp:
Feb 25, 2011, 9:26:54 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi-busybox/libbb/match_fstype.c

    r1765 r2725  
    66 *   mount -at ,noddy
    77 *
    8  * Returns 0 for a match, otherwise -1
     8 * Returns 1 for a match, otherwise 0
    99 *
    10  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
     10 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
    1111 */
    1212
    1313#include "libbb.h"
    1414
    15 int match_fstype(const struct mntent *mt, const char *fstype)
     15int FAST_FUNC match_fstype(const struct mntent *mt, const char *t_fstype)
    1616{
    17     int no = 0;
     17    int match = 1;
    1818    int len;
    1919
    20     if (!mt)
    21         return -1;
     20    if (!t_fstype)
     21        return match;
    2222
    23     if (!fstype)
    24         return 0;
    25 
    26     if (fstype[0] == 'n' && fstype[1] == 'o') {
    27         no = -1;
    28         fstype += 2;
     23    if (t_fstype[0] == 'n' && t_fstype[1] == 'o') {
     24        match--;
     25        t_fstype += 2;
    2926    }
    3027
    3128    len = strlen(mt->mnt_type);
    32     while (fstype) {
    33         if (!strncmp(mt->mnt_type, fstype, len)
    34          && (!fstype[len] || fstype[len] == ',')
     29    while (1) {
     30        if (strncmp(mt->mnt_type, t_fstype, len) == 0
     31         && (t_fstype[len] == '\0' || t_fstype[len] == ',')
    3532        ) {
    36             return no;
     33            return match;
    3734        }
    38         fstype = strchr(fstype, ',');
    39         if (fstype)
    40             fstype++;
     35        t_fstype = strchr(t_fstype, ',');
     36        if (!t_fstype)
     37            break;
     38        t_fstype++;
    4139    }
    4240
    43     return -(no + 1);
     41    return !match;
    4442}
Note: See TracChangeset for help on using the changeset viewer.