path: Actually use mtime instead of ctime

Fixes #9222
This commit is contained in:
Fabian Boehm 2022-09-20 16:05:46 +02:00
parent 3d8f98c395
commit 8b1da4b63d
2 changed files with 6 additions and 2 deletions

View file

@ -623,9 +623,9 @@ static int path_mtime(parser_t &parser, io_streams_t &streams, int argc, const w
n_transformed++;
if (!opts.relative) {
path_out(streams, opts, to_string(ret.change_seconds));
path_out(streams, opts, to_string(ret.mod_seconds));
} else {
path_out(streams, opts, to_string(t - ret.change_seconds));
path_out(streams, opts, to_string(t - ret.mod_seconds));
}
}
}

View file

@ -216,3 +216,7 @@ or echo mtime is too small
test $mtime -lt 20
or echo mtime is too large
touch -m -t 197001020000.00 epoch
path mtime epoch
# CHECK: 82800