diff options
author | Ron Yorston <rmy@pobox.com> | 2019-04-01 10:21:42 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2019-04-01 10:21:42 +0100 |
commit | 8b340122e5c5014358a4919d1e87ef2f81c83b6f (patch) | |
tree | 2aa63b22070dd9ccd5d54104b092b7e5c060b2b0 /win32 | |
parent | f6228015354adbdbbc736b33296112bebbc96cf3 (diff) | |
download | busybox-w32-8b340122e5c5014358a4919d1e87ef2f81c83b6f.tar.gz busybox-w32-8b340122e5c5014358a4919d1e87ef2f81c83b6f.tar.bz2 busybox-w32-8b340122e5c5014358a4919d1e87ef2f81c83b6f.zip |
df: display origin of mapped drive
When a drive is mapped to a network share or a path display the
mapping in the 'Filesystem' column of df's output.
Since this changes the mnt_fsname field of the mntent structure
a slight alteration is needed to print_all_cwd() in ash.
Revert the change in commit a8c63f25b that enabled FEATURE_DF_FANCY
in the default configuration. None of the additional options is
very useful.
See GitHub issue #164.
Diffstat (limited to 'win32')
-rw-r--r-- | win32/mntent.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/win32/mntent.c b/win32/mntent.c index 6d6ba319f..7ab51239d 100644 --- a/win32/mntent.c +++ b/win32/mntent.c | |||
@@ -8,7 +8,7 @@ struct mntdata { | |||
8 | DWORD flags; | 8 | DWORD flags; |
9 | int index; | 9 | int index; |
10 | struct mntent me; | 10 | struct mntent me; |
11 | char mnt_fsname[4]; | 11 | char mnt_fsname[PATH_MAX]; |
12 | char mnt_dir[4]; | 12 | char mnt_dir[4]; |
13 | char mnt_type[100]; | 13 | char mnt_type[100]; |
14 | char mnt_opts[4]; | 14 | char mnt_opts[4]; |
@@ -33,6 +33,7 @@ struct mntent *getmntent(FILE *stream) | |||
33 | struct mntdata *data = (struct mntdata *)stream; | 33 | struct mntdata *data = (struct mntdata *)stream; |
34 | struct mntent *entry; | 34 | struct mntent *entry; |
35 | UINT drive_type; | 35 | UINT drive_type; |
36 | char buf[PATH_MAX]; | ||
36 | 37 | ||
37 | data->me.mnt_fsname = data->mnt_fsname; | 38 | data->me.mnt_fsname = data->mnt_fsname; |
38 | data->me.mnt_dir = data->mnt_dir; | 39 | data->me.mnt_dir = data->mnt_dir; |
@@ -63,6 +64,12 @@ struct mntent *getmntent(FILE *stream) | |||
63 | continue; | 64 | continue; |
64 | } | 65 | } |
65 | 66 | ||
67 | if (realpath(data->mnt_dir, buf) != NULL) { | ||
68 | if (isalpha(buf[0]) && strcmp(buf+1, ":/") == 0) | ||
69 | buf[2] = '\0'; | ||
70 | strcpy(data->mnt_fsname, buf); | ||
71 | } | ||
72 | |||
66 | entry = &data->me; | 73 | entry = &data->me; |
67 | break; | 74 | break; |
68 | } | 75 | } |