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();
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 */
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)