summaryrefslogtreecommitdiffstats
path: root/sbin/mount/getmntopts.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1994-09-29 16:39:26 +0000
committerache <ache@FreeBSD.org>1994-09-29 16:39:26 +0000
commit445ab444e1597c9fa62fba52e9b53ba245bf6254 (patch)
treed76cec2ae1bfe7555ea17013845af2901b603f3e /sbin/mount/getmntopts.c
parent5d7c4c64ff46ee920afcab53de0c65c805705556 (diff)
downloadFreeBSD-src-445ab444e1597c9fa62fba52e9b53ba245bf6254.zip
FreeBSD-src-445ab444e1597c9fa62fba52e9b53ba245bf6254.tar.gz
Add code to skip "userquota"/"groupquota" options needed for
quotaon/quotacheck
Diffstat (limited to 'sbin/mount/getmntopts.c')
-rw-r--r--sbin/mount/getmntopts.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sbin/mount/getmntopts.c b/sbin/mount/getmntopts.c
index 2c84ae5..1af5e0f 100644
--- a/sbin/mount/getmntopts.c
+++ b/sbin/mount/getmntopts.c
@@ -53,7 +53,7 @@ getmntopts(options, m0, flagp)
int *flagp;
{
const struct mntopt *m;
- int negative;
+ int negative, len;
char *opt, *optbuf;
/* Copy option string, since it is about to be torn asunder... */
@@ -69,9 +69,14 @@ getmntopts(options, m0, flagp)
negative = 0;
/* Scan option table. */
- for (m = m0; m->m_option != NULL; ++m)
- if (strcasecmp(opt, m->m_option) == 0)
+ for (m = m0; m->m_option != NULL; ++m) {
+ len = strlen(m->m_option);
+ if (strncasecmp(opt, m->m_option, len) == 0)
+ if ( m->m_option[len] == '\0'
+ || m->m_option[len] == '='
+ )
break;
+ }
/* Save flag, or fail if option is not recognised. */
if (m->m_option) {
OpenPOWER on IntegriCloud