X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmount%2Fmount.c;h=62115bbdbfe579828e92e211670e6f477cd96380;hp=f3f0a8310164a02a860aa48b9ae13cfc2a1da6af;hb=30ebf04700654deddbf5f57d95e84ec69cea8610;hpb=c01e5ca6179b8f5b041605d9bbd75a0f76812d54 diff --git a/utils/mount/mount.c b/utils/mount/mount.c index f3f0a83..62115bb 100644 --- a/utils/mount/mount.c +++ b/utils/mount/mount.c @@ -374,7 +374,7 @@ static int try_mount(char *spec, char *mount_point, int flags, int main(int argc, char *argv[]) { int c, flags = 0, mnt_err = 1, fake = 0; - char *spec, *mount_point, *fs_type = "nfs"; + char *spec = NULL, *mount_point = NULL, *fs_type = "nfs"; char *extra_opts = NULL, *mount_opts = NULL; uid_t uid = getuid(); @@ -398,9 +398,6 @@ int main(int argc, char *argv[]) exit(EX_USAGE); } - spec = argv[1]; - mount_point = argv[2]; - mount_config_init(progname); argv[2] = argv[0]; /* so that getopt error messages are correct */ @@ -447,6 +444,14 @@ int main(int argc, char *argv[]) if (optind != argc - 2) { mount_usage(); goto out_usage; + } else { + while (optind < argc) { + if (!spec) + spec = argv[optind]; + else + mount_point = argv[optind]; + optind++; + } } if (strcmp(progname, "mount.nfs4") == 0)