diff options
author | Rong-En Fan <rafan@FreeBSD.org> | 2008-04-06 08:34:57 +0000 |
---|---|---|
committer | Rong-En Fan <rafan@FreeBSD.org> | 2008-04-06 08:34:57 +0000 |
commit | aadb4be16d2b654d5d77e4102f39552447599613 (patch) | |
tree | 931e0c45c3a89489498e9ec433d6cf25bd630a4e /archivers/unrar-iconv/files/patch-iconv | |
parent | - Update to 0.09.007 (diff) |
- Fix Unicode support
- Add some notes
PR: ports/122420
Submitted by: Yarodin <yarodin at gmail.com> (maintainer)
Notes
Notes:
svn path=/head/; revision=210632
Diffstat (limited to 'archivers/unrar-iconv/files/patch-iconv')
-rw-r--r-- | archivers/unrar-iconv/files/patch-iconv | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/archivers/unrar-iconv/files/patch-iconv b/archivers/unrar-iconv/files/patch-iconv index 422bb9255dc5..78318007e629 100644 --- a/archivers/unrar-iconv/files/patch-iconv +++ b/archivers/unrar-iconv/files/patch-iconv @@ -152,10 +152,10 @@ #ifdef S_IFLNK #define SAVE_LINKS #endif ---- strfn.cpp Tue Oct 4 11:57:54 2005 -+++ strfn.cpp Mon Jan 16 18:04:41 2006 +--- strfn.cpp.orig 2007-09-10 17:49:28.000000000 +0600 ++++ strfn.cpp 2008-04-03 21:15:08.000000000 +0600 @@ -22,23 +22,49 @@ - + void ExtToInt(const char *Src,char *Dest) { +#ifdef WITH_ICONV @@ -163,23 +163,23 @@ + ret = (size_t)(-1); + if (h_E2I != (iconv_t)(-1)) { + static size_t inbytesleft, outbytesleft; -+ -+ inbytesleft = strlen(Src); -+ outbytesleft = inbytesleft; ++ inbytesleft = strlen(Src)+1; ++ outbytesleft = NM; + ret = iconv(h_E2I, &Src, &inbytesleft, &Dest, &outbytesleft); ++ Dest[outbytesleft-inbytesleft]=NULL; + } -+ if (ret == (size_t)(-1)) strcpy(Dest, Src); -+#else /* !WITH_ICONV */ ++ if (ret == (size_t)(-1)) strcpy(Dest, Src); ++#else /* !WITH_ICONV */ #if defined(_WIN_32) CharToOem(Src,Dest); #else if (Dest!=Src) strcpy(Dest,Src); #endif -+#endif /* !WITH_ICONV */ ++#endif /* !WITH_ICONV */ } - - + + void IntToExt(const char *Src,char *Dest) { +#ifdef WITH_ICONV @@ -187,18 +187,18 @@ + ret = (size_t)(-1); + if (h_I2E != (iconv_t)(-1)) { + static size_t inbytesleft, outbytesleft; -+ -+ inbytesleft = strlen(Src); -+ outbytesleft = inbytesleft; ++ inbytesleft = strlen(Src)+1; ++ outbytesleft = NM; + ret = iconv(h_I2E, &Src, &inbytesleft, &Dest, &outbytesleft); ++ Dest[outbytesleft-inbytesleft]=NULL; + } -+ if (ret == (size_t)(-1)) strcpy(Dest, Src); -+#else /* !WITH_ICONV */ ++ if (ret == (size_t)(-1)) strcpy(Dest,Src); ++#else /* !WITH_ICONV */ #if defined(_WIN_32) OemToChar(Src,Dest); #else if (Dest!=Src) strcpy(Dest,Src); #endif -+#endif /* !WITH_ICONV */ ++#endif /* !WITH_ICONV */ } |