Ticket #1450: FISH: timestamps don't show correctly

Test case:
1) Make FISH-connect to some host;
2) sort files by modification time;
3) will see older files (from previous year) as new files

For check, connect to same host and enter in command line:

ls -lt

Thanks for bugreport to Alexander Glyzov.

Fix issue:
Because first part of FISH-ls script is Perl script.
But localtime function returns dates like:
Fri Sep 18 10:40:28 2009

But in utilvfs.c is written: So both year and time is not allowed.
This commit fixed write format of date.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Alexander Moiseenko 2009-11-25 10:40:16 +02:00 committed by Slava Zanko
parent 92247810e5
commit 11928eeff0

View File

@ -417,7 +417,7 @@ fish_dir_load(struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path)
"if (opendir ( DIR, $dirname )) {\n"
"while( (my $filename = readdir(DIR))){\n"
"my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = lstat(\"$dirname/$filename\");\n"
"my $mloctime= scalar localtime $mtime;\n"
"my $mloctime= strftime(\"%%m-%%d-%%Y %%H:%%M\", localtime $mtime);\n"
,
"my $strutils_shell_escape_regex= s/([;<>\\*\\|`&\\$!#\\(\\)\\[\\]\\{\\}:'\\''\"\\ \\\\])/\\\\$1/g;\n"
"my $e_filename = $filename;\n"