pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/net/libfetch



Module Name:    pkgsrc
Committed By:   joerg
Date:           Tue Aug 27 19:24:04 UTC 2019

Modified Files:
        pkgsrc/net/libfetch: Makefile
        pkgsrc/net/libfetch/files: http.c

Log Message:
libfetch-2.39: Improve date parsing


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 pkgsrc/net/libfetch/Makefile
cvs rdiff -u -r1.40 -r1.41 pkgsrc/net/libfetch/files/http.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/net/libfetch/Makefile
diff -u pkgsrc/net/libfetch/Makefile:1.60 pkgsrc/net/libfetch/Makefile:1.61
--- pkgsrc/net/libfetch/Makefile:1.60   Thu Sep  7 08:01:47 2017
+++ pkgsrc/net/libfetch/Makefile        Tue Aug 27 19:24:04 2019
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.60 2017/09/07 08:01:47 wiz Exp $
+# $NetBSD: Makefile,v 1.61 2019/08/27 19:24:04 joerg Exp $
 
-DISTNAME=      libfetch-2.38
+DISTNAME=      libfetch-2.39
 CATEGORIES=    net
 MASTER_SITES=  # empty
 DISTFILES=     # empty

Index: pkgsrc/net/libfetch/files/http.c
diff -u pkgsrc/net/libfetch/files/http.c:1.40 pkgsrc/net/libfetch/files/http.c:1.41
--- pkgsrc/net/libfetch/files/http.c:1.40       Fri Oct 21 11:51:18 2016
+++ pkgsrc/net/libfetch/files/http.c    Tue Aug 27 19:24:04 2019
@@ -1,4 +1,4 @@
-/*     $NetBSD: http.c,v 1.40 2016/10/21 11:51:18 jperkin Exp $        */
+/*     $NetBSD: http.c,v 1.41 2019/08/27 19:24:04 joerg Exp $  */
 /*-
  * Copyright (c) 2000-2004 Dag-Erling Co�dan Sm�rgrav
  * Copyright (c) 2003 Thomas Klausner <wiz%NetBSD.org@localhost>
@@ -526,14 +526,23 @@ http_next_header(conn_t *conn, const cha
 static int
 http_parse_mtime(const char *p, time_t *mtime)
 {
-       char locale[64], *r;
        struct tm tm;
+       char *r;
 
-       strncpy(locale, setlocale(LC_TIME, NULL), sizeof(locale));
+#ifdef LC_C_LOCALE
+       r = strptime_l(p, "%a, %d %b %Y %H:%M:%S GMT", &tm, LC_C_LOCALE);
+#else
+       char *locale;
+
+       locale = strdup(setlocale(LC_TIME, NULL));
+       if (locale == NULL)
+               return (-1);
        setlocale(LC_TIME, "C");
        r = strptime(p, "%a, %d %b %Y %H:%M:%S GMT", &tm);
        /* XXX should add support for date-2 and date-3 */
        setlocale(LC_TIME, locale);
+       free(locale);
+#endif
        if (r == NULL)
                return (-1);
        *mtime = timegm(&tm);



Home | Main Index | Thread Index | Old Index