[hackers] [ubase] mount: match on source rule too if argument is set || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Sat, 15 Mar 2014 18:52:15 +0100

commit 7569fd38058a112d1c96d8d7107acbcceba532c3
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sat Mar 15 17:11:55 2014 +0100

    mount: match on source rule too if argument is set
    
    Signed-off-by: Hiltjo Posthuma <hiltjo_AT_codemadness.org>

diff --git a/mount.c b/mount.c
index 3263424..4e14bde 100644
--- a/mount.c
+++ b/mount.c
_AT_@ -132,7 +132,9 @@ main(int argc, char *argv[])
                 if((fp = setmntent(files[i], "r"))) {
                         while((me = getmntent(fp))) {
                                 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;
                                         target = me->mnt_dir;
                                         if(!oflag)
Received on Sat Mar 15 2014 - 18:52:15 CET

This archive was generated by hypermail 2.3.0 : Sat Mar 15 2014 - 19:00:26 CET