diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index 99cab2301f9e..063660b5f0c7 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -81,7 +81,7 @@ int mountfs(const char *, const char *, const char *, int, const char *, const char *); void remopt(char *, const char *); void prmount(struct statfs *); -void putfsent(const struct statfs *); +void putfsent(struct statfs *); void usage(void); char *flags2opts(int); @@ -805,7 +805,7 @@ usage(void) } void -putfsent(const struct statfs *ent) +putfsent(struct statfs *ent) { struct fstab *fst; char *opts; @@ -813,6 +813,12 @@ putfsent(const struct statfs *ent) opts = flags2opts(ent->f_flags); + if (strncmp(ent->f_mntfromname, "", 7) == 0 || + strncmp(ent->f_mntfromname, "", 7) == 0) { + strcpy(ent->f_mntfromname, (strnstr(ent->f_mntfromname, ":", 8) + +1)); + } + /* * "rw" is not a real mount option; this is why we print NULL as "rw" * if opts is still NULL here.