diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2018-01-06 03:59:36 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2018-01-06 03:59:36 +0530 |
commit | d69365ff3e58ac08d0d5e6900ee503beb2ec8cd6 (patch) | |
tree | 3af6dea1171e0cc9dbf1d13bc6ecfb8cb58d24a4 | |
parent | 5876c61f4cfc1510040840cf5e3484596afe10d1 (diff) | |
download | nnn-d69365ff3e58ac08d0d5e6900ee503beb2ec8cd6.tar.gz |
Use a date format string
-rw-r--r-- | nnn.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -274,6 +274,7 @@ static const char *STR_ATROOT = "You are at /"; static const char *STR_NOHOME = "HOME not set"; static const char *STR_INPUT = "No traversal delimiter allowed"; static const char *STR_INVBM = "Invalid bookmark"; +static const char *STR_DATE = "%a %b %d %Y %T %z"; /* For use in functions which are isolated and don't return the buffer */ static char g_buf[MAX_CMD_LEN] __attribute__ ((aligned)); @@ -1582,15 +1583,15 @@ show_stats(char *fpath, char *fname, struct stat *sb) sb->st_mode & 7, perms, sb->st_uid, (getpwuid(sb->st_uid))->pw_name, sb->st_gid, (getgrgid(sb->st_gid))->gr_name); /* Show last access time */ - strftime(g_buf, 40, "%a %b %d %Y %T %z", localtime(&sb->st_atime)); + strftime(g_buf, 40, STR_DATE, localtime(&sb->st_atime)); dprintf(fd, "\n\n Access: %s", g_buf); /* Show last modification time */ - strftime(g_buf, 40, "%a %b %d %Y %T %z", localtime(&sb->st_mtime)); + strftime(g_buf, 40, STR_DATE, localtime(&sb->st_mtime)); dprintf(fd, "\n Modify: %s", g_buf); /* Show last status change time */ - strftime(g_buf, 40, "%a %b %d %Y %T %z", localtime(&sb->st_ctime)); + strftime(g_buf, 40, STR_DATE, localtime(&sb->st_ctime)); dprintf(fd, "\n Change: %s", g_buf); if (S_ISREG(sb->st_mode)) { |