chiark / gitweb /
tcl: Update from 8.6.5 to 8.6.6
[termux-packages] / packages / apt / apt-pkg-contrib-strutl.cc.patch
1 diff -u -r ../apt-1.1.3/apt-pkg/contrib/strutl.cc ./apt-pkg/contrib/strutl.cc
2 --- ../apt-1.1.3/apt-pkg/contrib/strutl.cc      2015-11-30 03:08:24.000000000 -0500
3 +++ ./apt-pkg/contrib/strutl.cc 2015-12-03 18:36:34.555425494 -0500
4 @@ -35,7 +35,9 @@
5  #include <regex.h>
6  #include <errno.h>
7  #include <stdarg.h>
8 +#ifndef __ANDROID__
9  #include <iconv.h>
10 +#endif
11  
12  #include <apti18n.h>
13                                                                         /*}}}*/
14 @@ -87,6 +89,7 @@
15  // UTF8ToCodeset - Convert some UTF-8 string for some codeset          /*{{{*/
16  // ---------------------------------------------------------------------
17  /* This is handy to use before display some information for enduser  */
18 +#ifndef __ANDROID__
19  bool UTF8ToCodeset(const char *codeset, const string &orig, string *dest)
20  {
21    iconv_t cd;
22 @@ -153,6 +156,7 @@
23  
24    return true;
25  }
26 +#endif
27                                                                         /*}}}*/
28  // strstrip - Remove white space from the front and back of a string   /*{{{*/
29  // ---------------------------------------------------------------------
30 @@ -392,14 +396,14 @@
31        if (ASize < 100 && I != 0)
32        {
33          std::string S;
34 -        strprintf(S, "%'.1f %c", ASize, Ext[I]);
35 +        strprintf(S, "%.1f %c", ASize, Ext[I]);
36          return S;
37        }
38  
39        if (ASize < 10000)
40        {
41          std::string S;
42 -        strprintf(S, "%'.0f %c", ASize, Ext[I]);
43 +        strprintf(S, "%.0f %c", ASize, Ext[I]);
44          return S;
45        }
46        ASize /= 1000.0;
47 @@ -928,14 +932,16 @@
48     setlocale (LC_ALL,"C");
49     bool const invalid =
50     // Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123
51 -      (strptime(str, "%a, %d %b %Y %H:%M:%S %Z", &Tm) == NULL &&
52 +      (strptime(str, "%a, %d %b %Y %H:%M:%S", &Tm) == NULL &&
53     // Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
54 -       strptime(str, "%A, %d-%b-%y %H:%M:%S %Z", &Tm) == NULL &&
55 +       strptime(str, "%A, %d-%b-%y %H:%M:%S", &Tm) == NULL &&
56     // Sun Nov  6 08:49:37 1994       ; ANSI C's asctime() format
57         strptime(str, "%a %b %d %H:%M:%S %Y", &Tm) == NULL);
58     setlocale (LC_ALL,"");
59 -   if (invalid == true)
60 +   if (invalid == true) {
61 +      if (str != NULL && strlen(str) > 1) printf("Invalid time str '%s'\n", str);
62        return false;
63 +   }
64  
65     time = timegm(&Tm);
66     return true;