mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Remove redundant variable
This commit is contained in:
parent
dcc9b62760
commit
2e3f013ce3
8
nnn.c
8
nnn.c
|
@ -1168,7 +1168,7 @@ unescape(const char *str, uint maxcols)
|
||||||
static char buffer[PATH_MAX];
|
static char buffer[PATH_MAX];
|
||||||
static wchar_t wbuf[PATH_MAX];
|
static wchar_t wbuf[PATH_MAX];
|
||||||
static wchar_t *buf;
|
static wchar_t *buf;
|
||||||
static size_t len, width;
|
static size_t len;
|
||||||
|
|
||||||
buffer[0] = '\0';
|
buffer[0] = '\0';
|
||||||
buf = wbuf;
|
buf = wbuf;
|
||||||
|
@ -1176,10 +1176,10 @@ unescape(const char *str, uint maxcols)
|
||||||
/* Convert multi-byte to wide char */
|
/* Convert multi-byte to wide char */
|
||||||
len = mbstowcs(wbuf, str, PATH_MAX);
|
len = mbstowcs(wbuf, str, PATH_MAX);
|
||||||
|
|
||||||
if (maxcols) {
|
if (maxcols && len > maxcols) {
|
||||||
width = wcswidth(wbuf, len);
|
len = wcswidth(wbuf, len);
|
||||||
|
|
||||||
if (width > maxcols)
|
if (len > maxcols)
|
||||||
wbuf[maxcols] = 0;
|
wbuf[maxcols] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue