Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/libbb/match_fstype.c
- Timestamp:
- Feb 25, 2011, 9:26:54 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi-busybox/libbb/match_fstype.c
r1765 r2725 6 6 * mount -at ,noddy 7 7 * 8 * Returns 0 for a match, otherwise -18 * Returns 1 for a match, otherwise 0 9 9 * 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. 11 11 */ 12 12 13 13 #include "libbb.h" 14 14 15 int match_fstype(const struct mntent *mt, const char *fstype)15 int FAST_FUNC match_fstype(const struct mntent *mt, const char *t_fstype) 16 16 { 17 int no = 0;17 int match = 1; 18 18 int len; 19 19 20 if (! mt)21 return -1;20 if (!t_fstype) 21 return match; 22 22 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; 29 26 } 30 27 31 28 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] == ',') 35 32 ) { 36 return no;33 return match; 37 34 } 38 fstype = strchr(fstype, ','); 39 if (fstype) 40 fstype++; 35 t_fstype = strchr(t_fstype, ','); 36 if (!t_fstype) 37 break; 38 t_fstype++; 41 39 } 42 40 43 return -(no + 1);41 return !match; 44 42 }
Note:
See TracChangeset
for help on using the changeset viewer.