termux-packages/packages/apt/apt-pkg-contrib-strutl.cc.patch

67 lines
2.1 KiB
Diff
Raw Normal View History

2015-12-04 02:00:19 +01:00
diff -u -r ../apt-1.1.3/apt-pkg/contrib/strutl.cc ./apt-pkg/contrib/strutl.cc
--- ../apt-1.1.3/apt-pkg/contrib/strutl.cc 2015-11-30 03:08:24.000000000 -0500
+++ ./apt-pkg/contrib/strutl.cc 2015-12-03 18:36:34.555425494 -0500
2015-06-13 01:03:31 +02:00
@@ -35,7 +35,9 @@
#include <regex.h>
#include <errno.h>
#include <stdarg.h>
+#ifndef __ANDROID__
#include <iconv.h>
+#endif
#include <apti18n.h>
/*}}}*/
2015-12-04 02:00:19 +01:00
@@ -87,6 +89,7 @@
2015-06-13 01:03:31 +02:00
// UTF8ToCodeset - Convert some UTF-8 string for some codeset /*{{{*/
// ---------------------------------------------------------------------
/* This is handy to use before display some information for enduser */
+#ifndef __ANDROID__
bool UTF8ToCodeset(const char *codeset, const string &orig, string *dest)
{
iconv_t cd;
2015-12-04 02:00:19 +01:00
@@ -153,6 +156,7 @@
2015-06-13 01:03:31 +02:00
return true;
}
+#endif
/*}}}*/
// strstrip - Remove white space from the front and back of a string /*{{{*/
// ---------------------------------------------------------------------
2015-12-04 02:00:19 +01:00
@@ -392,14 +396,14 @@
2015-06-13 01:03:31 +02:00
if (ASize < 100 && I != 0)
{
2015-12-04 02:00:19 +01:00
std::string S;
- strprintf(S, "%'.1f %c", ASize, Ext[I]);
+ strprintf(S, "%.1f %c", ASize, Ext[I]);
return S;
2015-06-13 01:03:31 +02:00
}
2015-12-04 02:00:19 +01:00
2015-06-13 01:03:31 +02:00
if (ASize < 10000)
{
2015-12-04 02:00:19 +01:00
std::string S;
- strprintf(S, "%'.0f %c", ASize, Ext[I]);
+ strprintf(S, "%.0f %c", ASize, Ext[I]);
return S;
2015-06-13 01:03:31 +02:00
}
ASize /= 1000.0;
2015-12-04 02:00:19 +01:00
@@ -928,14 +932,16 @@
2015-06-13 01:03:31 +02:00
setlocale (LC_ALL,"C");
bool const invalid =
// Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
- (strptime(str, "%a, %d %b %Y %H:%M:%S %Z", &Tm) == NULL &&
+ (strptime(str, "%a, %d %b %Y %H:%M:%S", &Tm) == NULL &&
// Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
- strptime(str, "%A, %d-%b-%y %H:%M:%S %Z", &Tm) == NULL &&
+ strptime(str, "%A, %d-%b-%y %H:%M:%S", &Tm) == NULL &&
// Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
strptime(str, "%a %b %d %H:%M:%S %Y", &Tm) == NULL);
setlocale (LC_ALL,"");
- if (invalid == true)
+ if (invalid == true) {
+ if (str != NULL && strlen(str) > 1) printf("Invalid time str '%s'\n", str);
return false;
+ }
time = timegm(&Tm);
return true;