From: Florian Fainelli Date: Tue, 27 Feb 2007 23:31:17 +0000 (+0000) Subject: Add ptp fix from #1261 X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=commitdiff_plain;h=189142e2bf5e648311e7864359ce18501e34865f;hp=3756bfd222381052cccb191f6a6dbf4cef97bb18 Add ptp fix from #1261 SVN-Revision: 6409 --- diff --git a/libs/libgphoto2/patches/01-ptp_iconv_fix.patch b/libs/libgphoto2/patches/01-ptp_iconv_fix.patch new file mode 100644 index 0000000000..987db1eed1 --- /dev/null +++ b/libs/libgphoto2/patches/01-ptp_iconv_fix.patch @@ -0,0 +1,23 @@ +diff -urN libgphoto2-2.3.1/camlibs/ptp2/ptp-pack.c libgphoto2-2.3.1.new/camlibs/ptp2/ptp-pack.c +--- libgphoto2-2.3.1/camlibs/ptp2/ptp-pack.c 2006-12-24 16:16:20.000000000 +0100 ++++ libgphoto2-2.3.1.new/camlibs/ptp2/ptp-pack.c 2007-02-28 00:17:17.000000000 +0100 +@@ -116,8 +116,17 @@ + nconv = iconv (params->cd_ucs2_to_locale, &stringp, &convlen, &locp, &convmax); + /* FIXME: handle size errors */ + loclstr[PTP_MAXSTRLEN*3] = '\0'; +- if (nconv == (size_t) -1) +- return NULL; ++ if (nconv == (size_t) -1) { ++ int i; ++ /* try the old way, in case iconv is broken */ ++ for (i=0;i127) ++ loclstr[i] = '?'; ++ else ++ loclstr[i] = string[i]; ++ } ++ string[loclen] = 0; ++ } + return strdup(loclstr); + } + return NULL;