summaryrefslogtreecommitdiff
path: root/src/signature.c
diff options
context:
space:
mode:
authorScott J. Goldman <scottjg@github.com>2013-06-02 02:13:45 -0700
committerScott J. Goldman <scottjg@github.com>2013-06-02 02:13:45 -0700
commitdc33b3d7b21b2003d6835a06fecf9ed4f4535f7e (patch)
tree0747eb69f2a874e6ef271b007f847c1678578fbc /src/signature.c
parentcfbd08a59cd70b3328b149499a91ff4fb8487d9a (diff)
downloadlibgit2-dc33b3d7b21b2003d6835a06fecf9ed4f4535f7e.tar.gz
Don't bail on parsing commits with an invalid timezone
git doesn't do that, and it's not something that's usually actionable to fix. if you have a git repository with one bad timezone in the history, it's too late to change it most likely.
Diffstat (limited to 'src/signature.c')
-rw-r--r--src/signature.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/signature.c b/src/signature.c
index 1131fb789..cd6167fb4 100644
--- a/src/signature.c
+++ b/src/signature.c
@@ -174,8 +174,10 @@ int git_signature__parse(git_signature *sig, const char **buffer_out,
tz_start = time_end + 1;
if ((tz_start[0] != '-' && tz_start[0] != '+') ||
- git__strtol32(&offset, tz_start + 1, &tz_end, 10) < 0)
- return signature_error("malformed timezone");
+ git__strtol32(&offset, tz_start + 1, &tz_end, 10) < 0) {
+ //malformed timezone, just assume it's zero
+ offset = 0;
+ }
hours = offset / 100;
mins = offset % 100;