Skip to content

Commit

Permalink
Fix #522: Increase size of the internal date buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas committed Jul 17, 2017
1 parent 5945563 commit ad628fc
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Bug fixes:
- Fix reading from stdin for `tig show`.
- Document problem of outdated system-wide `tigrc` files in Homebrew. (GH #598)
- Repaint the display when toggling `line-graphics`. (GH #527)
- Fix custom date formatting support longer strings. (GH #522)

tig-2.2.2
---------
Expand Down
2 changes: 1 addition & 1 deletion src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ get_relative_date(const struct time *time, char *buf, size_t buflen, bool compac
const char *
mkdate(const struct time *time, enum date date, bool local, const char *custom_format)
{
static char buf[STRING_SIZE("2006-04-29 14:21") + 1];
static char buf[SIZEOF_STR];
struct tm tm;
const char *format;

Expand Down
34 changes: 34 additions & 0 deletions test/main/date-test
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ steps '
:toggle date
:save-display no-date.screen
:set main-view-date = custom
:set main-view-date-local = true
:set main-view-date-format = "%F %R %Z"
:save-display custom-date.screen
'

test_tig --pretty=raw < "$source_dir/$test.in"
Expand Down Expand Up @@ -205,3 +210,32 @@ Jonas Fonseca Only split the tree view when the tree view is visible
Jonas Fonseca Initial commit
[main] 91912eb97da4f6907015dab41ef9bba315730854 - commit 1 of 25 100%
EOF

assert_equals 'custom-date.screen' <<EOF
2015-08-30 19:01 UTC Kentaro Wada Add zsh completion file for autoload
2015-08-23 22:32 UTC Jonas Fonseca Refactor DEFINE_ALLOCATOR to use helper
2015-07-16 09:46 UTC Sven Wegener display: factor out separator functions
2015-08-22 20:20 UTC Jonas Fonseca Merge pull request #429 from ideal/mast
2015-08-18 07:24 UTC ideal check if mem is NULL in DEFINE_ALLOCATO
2015-06-08 03:44 UTC Jonas Fonseca Use git_init to initialize the test/sta
2015-04-07 00:34 UTC Jonas Fonseca Keep unstaged changes view open after a
2015-03-30 11:43 UTC Jonas Fonseca When redrawing the readline prompt also
2015-02-03 02:53 UTC Jonas Fonseca Move script helper before usages in the
2015-01-29 15:44 UTC Jonas Fonseca Merge branch 'hashed-refs'
2014-12-04 16:22 UTC Jonas Fonseca hashed-refs: Use a hash table as the ma
2014-11-08 14:55 UTC Jonas Fonseca Unify option_info lookup for normal opt
2014-10-07 01:22 UTC Jonas Fonseca Add option to turn off automatic enabli
2014-09-23 10:54 UTC Tom Greuter Add option to install Tig with Homebrew
2014-09-04 11:19 UTC Jonas Fonseca Fix diff context restoring for diff ope
2013-12-14 22:55 UTC Michael Barlow Add mouse support
2012-10-01 02:43 UTC Jonas Fonseca Refactor stage view title formatting
2012-08-30 14:47 UTC Jonas Fonseca [GH #83] WIP: main view lazy navigation
2011-10-13 06:16 UTC P. Sadik Create and use dup() of STDIN_FILENO in
2010-09-16 01:01 UTC Jonathan Neuschäfer Don't show out-of-sight tildes
2010-06-28 08:26 UTC Pierre Habouzit Add an option to ignore unknown directo
2009-01-17 22:10 UTC Jonas Fonseca Fix another regression from the dirty f
2007-09-29 21:23 UTC Jonas Fonseca tig-0.10.git
2006-09-11 22:22 UTC Jonas Fonseca Only split the tree view when the tree
2006-04-10 16:39 UTC Jonas Fonseca Initial commit
[main] 91912eb97da4f6907015dab41ef9bba315730854 - commit 1 of 25 100%
EOF

0 comments on commit ad628fc

Please sign in to comment.