diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-05-06 21:50:25 -0700 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-05-06 21:50:25 -0700 |
commit | df4f88fe3198acea6267c6ed3b129af7d8972bf1 (patch) | |
tree | 12aa58e43bdd457f8fccd5fef49dc6831368f0f3 /src/undo.c | |
parent | 85459327ba76d674572ad96dc459c97e4a71e88d (diff) | |
parent | 151382d533c2bd77e26e1dfc254e186f7496e226 (diff) | |
download | rneovim-df4f88fe3198acea6267c6ed3b129af7d8972bf1.tar.gz rneovim-df4f88fe3198acea6267c6ed3b129af7d8972bf1.tar.bz2 rneovim-df4f88fe3198acea6267c6ed3b129af7d8972bf1.zip |
Merge pull request #644 from philix/log
Macro-based log utility for Neovim
Diffstat (limited to 'src/undo.c')
-rw-r--r-- | src/undo.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/undo.c b/src/undo.c index 0f547f475b..660fe83fdd 100644 --- a/src/undo.c +++ b/src/undo.c @@ -103,6 +103,7 @@ #include "screen.h" #include "sha256.h" #include "os/os.h" +#include "os/time.h" static long get_undolevel(void); static void u_unch_branch(u_header_T *uhp); @@ -2455,16 +2456,16 @@ void ex_undolist(exarg_T *eap) */ static void u_add_time(char_u *buf, size_t buflen, time_t tt) { - struct tm *curtime; + struct tm curtime; if (time(NULL) - tt >= 100) { - curtime = localtime(&tt); + os_localtime_r(&tt, &curtime); if (time(NULL) - tt < (60L * 60L * 12L)) /* within 12 hours */ - (void)strftime((char *)buf, buflen, "%H:%M:%S", curtime); + (void)strftime((char *)buf, buflen, "%H:%M:%S", &curtime); else /* longer ago */ - (void)strftime((char *)buf, buflen, "%Y/%m/%d %H:%M:%S", curtime); + (void)strftime((char *)buf, buflen, "%Y/%m/%d %H:%M:%S", &curtime); } else vim_snprintf((char *)buf, buflen, _("%" PRId64 " seconds ago"), (int64_t)(time(NULL) - tt)); |