diff options
Diffstat (limited to 'src/misc/mntent.c')
-rw-r--r-- | src/misc/mntent.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/misc/mntent.c b/src/misc/mntent.c index ee17a69f..76f9c162 100644 --- a/src/misc/mntent.c +++ b/src/misc/mntent.c @@ -115,5 +115,13 @@ int addmntent(FILE *f, const struct mntent *mnt) char *hasmntopt(const struct mntent *mnt, const char *opt) { - return strstr(mnt->mnt_opts, opt); + size_t l = strlen(opt); + char *p = mnt->mnt_opts; + for (;;) { + if (!strncmp(p, opt, l) && (!p[l] || p[l]==',' || p[l]=='=')) + return p; + p = strchr(p, ','); + if (!p) return 0; + p++; + } } |