struct mntentchn *mc = NULL;
const char *devname = NULL;
+ if (!spec && !uuid && !label)
+ return NULL;
+
/*
* A) 99% of all cases, the spec on cmdline matches
* with spec in fstab
* Earlier mtab was tried first, but this would sometimes try the
* wrong mount in case mtab had the root device entry wrong.
*/
- if (!mc)
+ if (!mc && (devname || spec))
mc = getmntfile (devname ? devname : spec);
if (devname)
case 1:
/* mount [-nfrvw] [-o options] special | node
+ * mount -L label (or -U uuid)
* (/etc/fstab is necessary)
*/
if (types != NULL)
usage (stderr, EX_USAGE);
- mc = getfs(*argv, uuid, label);
+ if (uuid || label)
+ mc = getfs(NULL, uuid, label);
+ else
+ mc = getfs(*argv, NULL, NULL);
+
if (!mc) {
if (uuid || label)
die (EX_USAGE, _("mount: no such partition found"));