Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/date.c
diff options
context:
space:
mode:
Diffstat (limited to 'date.c')
-rw-r--r--date.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/date.c b/date.c
index 782de95d90..76fb47518d 100644
--- a/date.c
+++ b/date.c
@@ -696,6 +696,9 @@ int parse_date_basic(const char *date, unsigned long *timestamp, int *offset)
/* mktime uses local timezone */
*timestamp = tm_to_time_t(&tm);
+ if (*timestamp == -1)
+ return -1;
+
if (*offset == -1) {
time_t temp_time = mktime(&tm);
if ((time_t)*timestamp > temp_time) {
@@ -705,9 +708,6 @@ int parse_date_basic(const char *date, unsigned long *timestamp, int *offset)
}
}
- if (*timestamp == -1)
- return -1;
-
if (!tm_gmt)
*timestamp -= *offset * 60;
return 0; /* success */