Add ptp fix from #1261
git-svn-id: svn://svn.openwrt.org/openwrt/packages@6409 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
4ba1c9b85a
commit
c7a154b716
23
libs/libgphoto2/patches/01-ptp_iconv_fix.patch
Normal file
23
libs/libgphoto2/patches/01-ptp_iconv_fix.patch
Normal file
@ -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;i<loclen;i++) {
|
||||
+ if (string[i]>127)
|
||||
+ loclstr[i] = '?';
|
||||
+ else
|
||||
+ loclstr[i] = string[i];
|
||||
+ }
|
||||
+ string[loclen] = 0;
|
||||
+ }
|
||||
return strdup(loclstr);
|
||||
}
|
||||
return NULL;
|
Loading…
x
Reference in New Issue
Block a user