summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbp <bp@FreeBSD.org>2002-07-22 09:50:09 +0000
committerbp <bp@FreeBSD.org>2002-07-22 09:50:09 +0000
commit7ca5837b3ab38e740593393a3978545597de05c7 (patch)
tree1bb378b2f712b20948b20737cb9a94912687c974
parentdb214eb6c86c325f23808c0dd418c14a025da935 (diff)
parent558db90d74fe48ae5169f44a933780f82456c29f (diff)
downloadFreeBSD-src-7ca5837b3ab38e740593393a3978545597de05c7.zip
FreeBSD-src-7ca5837b3ab38e740593393a3978545597de05c7.tar.gz
This commit was generated by cvs2svn to compensate for changes in r100490,
which included commits to RCS files with non-trunk default branches.
-rw-r--r--contrib/smbfs/HISTORY4
-rw-r--r--contrib/smbfs/lib/smb/nls.c26
2 files changed, 25 insertions, 5 deletions
diff --git a/contrib/smbfs/HISTORY b/contrib/smbfs/HISTORY
index 4de0e7b..f7aad60 100644
--- a/contrib/smbfs/HISTORY
+++ b/contrib/smbfs/HISTORY
@@ -1,3 +1,7 @@
+22.07.2002 1.4.5 (bug fix only)
+ - Some iconv libraries may refuse to recode some characters. This
+ caused problems with translation between server and local charsets.
+
16.04.2002 1.4.4
- Workaround for W2K bug in resource listing.
- Minor bug fixes.
diff --git a/contrib/smbfs/lib/smb/nls.c b/contrib/smbfs/lib/smb/nls.c
index 38db2e1..19c3123 100644
--- a/contrib/smbfs/lib/smb/nls.c
+++ b/contrib/smbfs/lib/smb/nls.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: nls.c,v 1.9 2001/08/22 03:31:36 bp Exp $
+ * $Id: nls.c,v 1.10 2002/07/22 08:33:59 bp Exp $
*/
#include <sys/types.h>
@@ -134,7 +134,11 @@ nls_str_toloc(char *dst, const char *src)
return strcpy(dst, src);
inlen = outlen = strlen(src);
my_iconv(nls_toloc, NULL, NULL, &p, &outlen);
- my_iconv(nls_toloc, &src, &inlen, &p, &outlen);
+ while (my_iconv(nls_toloc, &src, &inlen, &p, &outlen) == -1) {
+ *p++ = *src++;
+ inlen--;
+ outlen--;
+ }
*p = 0;
return dst;
}
@@ -152,7 +156,11 @@ nls_str_toext(char *dst, const char *src)
return strcpy(dst, src);
inlen = outlen = strlen(src);
my_iconv(nls_toext, NULL, NULL, &p, &outlen);
- my_iconv(nls_toext, &src, &inlen, &p, &outlen);
+ while (my_iconv(nls_toext, &src, &inlen, &p, &outlen) == -1) {
+ *p++ = *src++;
+ inlen--;
+ outlen--;
+ }
*p = 0;
return dst;
}
@@ -174,7 +182,11 @@ nls_mem_toloc(void *dst, const void *src, int size)
return memcpy(dst, src, size);
inlen = outlen = size;
my_iconv(nls_toloc, NULL, NULL, &p, &outlen);
- my_iconv(nls_toloc, &s, &inlen, &p, &outlen);
+ while (my_iconv(nls_toloc, &s, &inlen, &p, &outlen) == -1) {
+ *p++ = *s++;
+ inlen--;
+ outlen--;
+ }
return dst;
}
@@ -193,7 +205,11 @@ nls_mem_toext(void *dst, const void *src, int size)
inlen = outlen = size;
my_iconv(nls_toext, NULL, NULL, &p, &outlen);
- my_iconv(nls_toext, &s, &inlen, &p, &outlen);
+ while (my_iconv(nls_toext, &s, &inlen, &p, &outlen) == -1) {
+ *p++ = *s++;
+ inlen--;
+ outlen--;
+ }
return dst;
}
OpenPOWER on IntegriCloud