1 --- busybox-1.00/.pc/mount-all-type.patch/util-linux/mount.c 2004-08-02 17:14:02.000000000 -0700
2 +++ busybox-1.00/util-linux/mount.c 2005-05-13 00:17:19.054232796 -0700
7 +/* Does this file system type, from /etc/fstab, match the given
10 +static int match_fs(const char *option, const char *type)
12 + const int len = strlen(type);
13 + const int no = option[0] == 'n' && option[1] == 'o';
14 + const char *optp = option;
17 + const char *match = strstr(optp, type);
19 + if (match == NULL) {
20 + /* No match, but if the option string starts 'no' no match
26 + /* Match, may be partial, check for end-of-type in option string. */
27 + if (match[len] == 0 || match[len] == ',') {
28 + /* Ok, check for type or notype. */
29 + if (match == option) {
30 + /* Exact match at start (can't be 'no') */
33 + if (match > option+1) {
34 + if (match[-1] == ',') {
35 + /* Exact match in middle, might be 'no' */
38 + if (match == option+2 && no) {
39 + /* Exact match to 'notype' at start. */
42 + if (match > option+2 && match[-3] == ',' &&
43 + match[-2] == 'n' && match[-1] == 'o') {
49 + /* Look for another match. */
53 + /* zero length type in fstab (impossible?), don't match it. */
57 extern int mount_main(int argc, char **argv)
63 char *filesystemType = "auto";
64 + char *filesystemOption = 0;
65 int got_filesystemType = 0;
66 char *device = xmalloc(PATH_MAX);
67 char *directory = xmalloc(PATH_MAX);
71 filesystemType = optarg;
72 + filesystemOption = optarg;
73 got_filesystemType = 1;
78 strcpy(device, m->mnt_fsname);
79 strcpy(directory, m->mnt_dir);
80 + if (all && filesystemOption != 0 && !match_fs(filesystemOption, m->mnt_type))
82 filesystemType = bb_xstrdup(m->mnt_type);
84 extra_opts = string_flags;