diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-08-02 14:37:16 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-08-02 14:37:16 +0200 |
commit | 7ae4e473daef440b3931b315a01245e17b784a8f (patch) | |
tree | 090a4d73d41390758642a2eba3f251f404d5177d /sys/src/cmd/ip | |
parent | 7cc757c3c01e09c73034d8f08226ca1fd34c4e6b (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.c | 7 |
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; |