mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
mbstowcs() returns the codepoints
This commit is contained in:
parent
b854f396cf
commit
ccdb95f3ab
5
nnn.c
5
nnn.c
|
@ -1013,10 +1013,9 @@ xreadline(char *fname)
|
||||||
size_t buflen = NAME_MAX - 1;
|
size_t buflen = NAME_MAX - 1;
|
||||||
|
|
||||||
DPRINTF_S(fname)
|
DPRINTF_S(fname)
|
||||||
mbstowcs(buf, fname, NAME_MAX);
|
len = pos = mbstowcs(buf, fname, NAME_MAX);
|
||||||
len = pos = wcslen(buf);
|
|
||||||
/* For future: handle NULL, say for a new name */
|
/* For future: handle NULL, say for a new name */
|
||||||
if (len <= 0) {
|
if (len == (size_t)-1) {
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
len = pos = 0;
|
len = pos = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue