diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2021-06-20 14:46:19 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-06-20 14:46:19 +0200 |
commit | a2a9113f35741f9d01f0b5fd5d45d6387681fdb5 (patch) | |
tree | f0533b6ae732209c79b489591410a3ffc9d02028 /coreutils | |
parent | d71c7892ac56939cfcf3fa699ee8b0195631ee5a (diff) | |
download | busybox-w32-a2a9113f35741f9d01f0b5fd5d45d6387681fdb5.tar.gz busybox-w32-a2a9113f35741f9d01f0b5fd5d45d6387681fdb5.tar.bz2 busybox-w32-a2a9113f35741f9d01f0b5fd5d45d6387681fdb5.zip |
df: POSIXLY_CORRECT sets _default_ scale, -m/-h overrides it
function old new delta
df_main 1034 1029 -5
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/df.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/coreutils/df.c b/coreutils/df.c index debb86867..a659353c0 100644 --- a/coreutils/df.c +++ b/coreutils/df.c | |||
@@ -113,6 +113,13 @@ int df_main(int argc UNUSED_PARAM, char **argv) | |||
113 | 113 | ||
114 | init_unicode(); | 114 | init_unicode(); |
115 | 115 | ||
116 | /* From the manpage of df from coreutils-6.10: | ||
117 | * Disk space is shown in 1K blocks by default, unless the environment | ||
118 | * variable POSIXLY_CORRECT is set, in which case 512-byte blocks are used. | ||
119 | */ | ||
120 | if (getenv("POSIXLY_CORRECT")) /* TODO - a new libbb function? */ | ||
121 | df_disp_hr = 512; | ||
122 | |||
116 | opt = getopt32(argv, "^" | 123 | opt = getopt32(argv, "^" |
117 | "kPT" | 124 | "kPT" |
118 | IF_FEATURE_DF_FANCY("aiB:") | 125 | IF_FEATURE_DF_FANCY("aiB:") |
@@ -142,13 +149,6 @@ int df_main(int argc UNUSED_PARAM, char **argv) | |||
142 | got_it: ; | 149 | got_it: ; |
143 | } | 150 | } |
144 | 151 | ||
145 | /* From the manpage of df from coreutils-6.10: | ||
146 | * Disk space is shown in 1K blocks by default, unless the environment | ||
147 | * variable POSIXLY_CORRECT is set, in which case 512-byte blocks are used. | ||
148 | */ | ||
149 | if (getenv("POSIXLY_CORRECT")) /* TODO - a new libbb function? */ | ||
150 | df_disp_hr = 512; | ||
151 | |||
152 | if (opt & OPT_HUMAN) { | 152 | if (opt & OPT_HUMAN) { |
153 | df_disp_hr = 0; | 153 | df_disp_hr = 0; |
154 | disp_units_hdr = " Size"; | 154 | disp_units_hdr = " Size"; |