mount: match on source rule too if argument is set
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
This commit is contained in:
parent
5b5cb8447e
commit
7569fd3805
4
mount.c
4
mount.c
@ -132,7 +132,9 @@ main(int argc, char *argv[])
|
|||||||
if((fp = setmntent(files[i], "r"))) {
|
if((fp = setmntent(files[i], "r"))) {
|
||||||
while((me = getmntent(fp))) {
|
while((me = getmntent(fp))) {
|
||||||
if(strcmp(me->mnt_dir, target) == 0 ||
|
if(strcmp(me->mnt_dir, target) == 0 ||
|
||||||
strcmp(me->mnt_fsname, target) == 0) {
|
strcmp(me->mnt_fsname, target) == 0 ||
|
||||||
|
(source && strcmp(me->mnt_dir, source) == 0) ||
|
||||||
|
(source && strcmp(me->mnt_fsname, source) == 0)) {
|
||||||
source = me->mnt_fsname;
|
source = me->mnt_fsname;
|
||||||
target = me->mnt_dir;
|
target = me->mnt_dir;
|
||||||
if(!oflag)
|
if(!oflag)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user