← Commit list

a2a9113f3

Denys Vlasenko
Denys Vlasenko
2021-06-20
SUCCESS Duration: 165s

Subject

df: POSIXLY_CORRECT sets _default_ scale, -m/-h overrides it

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

coreutils/df.c+7 -7
@@ -113,6 +113,13 @@ int df_main(int argc UNUSED_PARAM, char **argv)
init_unicode();
+ /* From the manpage of df from coreutils-6.10:
+ * Disk space is shown in 1K blocks by default, unless the environment
+ * variable POSIXLY_CORRECT is set, in which case 512-byte blocks are used.
+ */
+ if (getenv("POSIXLY_CORRECT")) /* TODO - a new libbb function? */
+ df_disp_hr = 512;
+
opt = getopt32(argv, "^"
"kPT"
IF_FEATURE_DF_FANCY("aiB:")
@@ -142,13 +149,6 @@ int df_main(int argc UNUSED_PARAM, char **argv)
got_it: ;
}
- /* From the manpage of df from coreutils-6.10:
- * Disk space is shown in 1K blocks by default, unless the environment
- * variable POSIXLY_CORRECT is set, in which case 512-byte blocks are used.
- */
- if (getenv("POSIXLY_CORRECT")) /* TODO - a new libbb function? */
- df_disp_hr = 512;
-
if (opt & OPT_HUMAN) {
df_disp_hr = 0;
disp_units_hdr = " Size";