summaryrefslogtreecommitdiff
path: root/sys/src/cmd/ip
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-08-02 14:37:16 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2014-08-02 14:37:16 +0200
commit7ae4e473daef440b3931b315a01245e17b784a8f (patch)
tree090a4d73d41390758642a2eba3f251f404d5177d /sys/src/cmd/ip
parent7cc757c3c01e09c73034d8f08226ca1fd34c4e6b (diff)
ftpfs: dont convert names to latin when string is valid utf-8
Diffstat (limited to 'sys/src/cmd/ip')
-rw-r--r--sys/src/cmd/ip/ftpfs/proto.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/src/cmd/ip/ftpfs/proto.c b/sys/src/cmd/ip/ftpfs/proto.c
index 0231dd7c9..14fe56ee9 100644
--- a/sys/src/cmd/ip/ftpfs/proto.c
+++ b/sys/src/cmd/ip/ftpfs/proto.c
@@ -1517,14 +1517,17 @@ fromlatin1(char *from)
{
char *p, *to;
Rune r;
+ int n;
if(os == Plan9)
return nil;
/* don't convert if we don't have to */
- for(p = from; *p; p++)
- if(*p & 0x80)
+ for(p = from; *p; p += n){
+ n = chartorune(&r, p);
+ if(r == Runeerror)
break;
+ }
if(*p == 0)
return nil;