diff options
Diffstat (limited to 'community/gvm-libs/strptime.patch')
-rw-r--r-- | community/gvm-libs/strptime.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/community/gvm-libs/strptime.patch b/community/gvm-libs/strptime.patch new file mode 100644 index 00000000000..d2c98d51078 --- /dev/null +++ b/community/gvm-libs/strptime.patch @@ -0,0 +1,32 @@ +diff --git a/base/nvti.c b/base/nvti.c +index 97f1ec63..f1f36cc7 100644 +--- a/base/nvti.c ++++ b/base/nvti.c +@@ -192,22 +192,19 @@ parse_nvt_timestamp (const gchar *str_time) + /* $Date: 2012-02-17 16:05:26 +0100 (Fr, 17. Feb 2012) $ */ + /* $Date: Fri, 11 Nov 2011 14:42:28 +0100 $ */ + memset (&tm, 0, sizeof (struct tm)); +- if (strptime ((char *) str_time, "%F %T %z", &tm) == NULL) ++ if (strptime ((char *) str_time, "%Y-%m-%d %T +%H%M", &tm) == NULL && strptime ((char *) str_time, "%Y-%m-%d %T -%H%M", &tm) == NULL) + { + memset (&tm, 0, sizeof (struct tm)); +- if (strptime ((char *) str_time, "$Date: %F %T %z", &tm) == NULL) ++ if (strptime ((char *) str_time, "$Date: %Y-%m-%d %T +%H%M", &tm) == NULL && strptime ((char *) str_time, "$Date: %Y-%m-%d %T -%H%M", &tm) == NULL) + { + memset (&tm, 0, sizeof (struct tm)); +- if (strptime ((char *) str_time, "%a %b %d %T %Y %z", &tm) == NULL) ++ if (strptime ((char *) str_time, "%a %b %d %T %Y +%H%M", &tm) == NULL && strptime ((char *) str_time, "%a %b %d %T %Y -%H%M", &tm) == NULL) + { + memset (&tm, 0, sizeof (struct tm)); +- if (strptime ((char *) str_time, "$Date: %a, %d %b %Y %T %z", &tm) +- == NULL) ++ if (strptime ((char *) str_time, "$Date: %a, %d %b %Y %T +%H%M", &tm) == NULL && strptime ((char *) str_time, "$Date: %a, %d %b %Y %T -%H%M", &tm) == NULL) + { + memset (&tm, 0, sizeof (struct tm)); +- if (strptime ((char *) str_time, "$Date: %a %b %d %T %Y %z", +- &tm) +- == NULL) ++ if (strptime ((char *) str_time, "$Date: %a %b %d %T %Y +%H%M", &tm) == NULL && strptime ((char *) str_time, "$Date: %a %b %d %T %Y -%H%M", &tm) == NULL) + { + g_warning ("%s: Failed to parse time: %s", __FUNCTION__, + str_time); |