diff --git a/src/uu/df/df.rs b/src/uu/df/df.rs index 6b7dfc0d9..732e48afb 100644 --- a/src/uu/df/df.rs +++ b/src/uu/df/df.rs @@ -356,11 +356,13 @@ impl MountInfo { #[cfg(target_os = "linux")] fn new(file_name: &str, raw: Vec<&str>) -> Option { match file_name { + // Format: 36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue + // "man proc" for more details "/proc/self/mountinfo" => { let mut m = MountInfo { dev_id: "".to_string(), - dev_name: raw[8].to_string(), - fs_type: raw[7].to_string(), + dev_name: raw[9].to_string(), + fs_type: raw[8].to_string(), mount_root: raw[3].to_string(), mount_dir: raw[4].to_string(), mount_option: raw[5].to_string(), diff --git a/tests/test_df.rs b/tests/test_df.rs index e97a34b49..03903049a 100644 --- a/tests/test_df.rs +++ b/tests/test_df.rs @@ -6,4 +6,11 @@ fn test_df_compatible() { let result = ucmd.arg("-ah").run(); assert!(result.success); } + +#[test] +fn test_df_compatible_type() { + let (_, mut ucmd) = at_and_ucmd!(); + let result = ucmd.arg("-aT").run(); + assert!(result.success); +} // TODO