summaryrefslogtreecommitdiffstats
path: root/sbin/mount/getmntopts.c
diff options
context:
space:
mode:
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