summary refs log tree commit diff
path: root/lr.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-02-27 19:03:39 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2016-02-27 19:03:39 +0100
commitd0dfe2659d440785058fdce0529dd610d9fef01a (patch)
treeb0b0d3a8825387f39c5cc5211a804f41440f7e4e /lr.c
parent4cfc92763aea3007f802647370de61da7f5038a2 (diff)
downloadlr-d0dfe2659d440785058fdce0529dd610d9fef01a.tar.gz
lr-d0dfe2659d440785058fdce0529dd610d9fef01a.tar.xz
lr-d0dfe2659d440785058fdce0529dd610d9fef01a.zip
fix time stamp selection
Diffstat (limited to 'lr.c')
-rw-r--r--lr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lr.c b/lr.c
index f5e2e32..f21cefc 100644
--- a/lr.c
+++ b/lr.c
@@ -1513,14 +1513,15 @@ print_format(struct fileinfo *fi)
 		case 'T': {
 			char tfmt[3] = "%\0\0";
 			char buf[256];
-			s++;
-			if (!*s)
-				break;
 
 			time_t t = (*s == 'A' ? fi->sb.st_atime :
 			    *s == 'C' ? fi->sb.st_ctime :
 			    fi->sb.st_mtime);
 
+			s++;
+			if (!*s)
+				break;
+
 			color_age_on(t);
 			if (*s == '-') {
 				printf("%3ldd%3ldh%3ldm%3lds",