ソースを参照

Remove redundant variable

master
Arun Prakash Jana 5年前
コミット
d33f469296
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: A75979F35C080412
1個のファイルの変更5行の追加5行の削除
  1. +5
    -5
      src/nnn.c

+ 5
- 5
src/nnn.c ファイルの表示

@@ -3152,7 +3152,6 @@ static void redraw(char *path)
int ncols = (xcols <= PATH_MAX) ? xcols : PATH_MAX; int ncols = (xcols <= PATH_MAX) ? xcols : PATH_MAX;
int lastln = xlines, onscreen = xlines - 4; int lastln = xlines, onscreen = xlines - 4;
int i, attrs; int i, attrs;
size_t len = strlen(path);
char buf[12]; char buf[12];
char c; char c;
char *ptr = path, *base; char *ptr = path, *base;
@@ -3207,25 +3206,26 @@ static void redraw(char *path)
attron(A_UNDERLINE); attron(A_UNDERLINE);


/* Print path */ /* Print path */
if ((len + 11) <= (size_t)ncols) i = (int)strlen(path);
if ((i + 11) <= ncols)
addnstr(path, ncols - 11); addnstr(path, ncols - 11);
else { else {
base = xbasename(path); base = xbasename(path);
if ((base - ptr) <= 1) if ((base - ptr) <= 1)
addnstr(path, ncols - 11); addnstr(path, ncols - 11);
else { else {
len = 0; i = 0;
--base; --base;
while (ptr < base) { while (ptr < base) {
if (*ptr == '/') { if (*ptr == '/') {
addch(*ptr); addch(*ptr);
addch(*(++ptr)); addch(*(++ptr));
len += 2; /* 2 characters added */ i += 2; /* 2 characters added */
} }
++ptr; ++ptr;
} }


addnstr(base, ncols - (11 + len + 1)); addnstr(base, ncols - (11 + i));
} }
} }




||||||
x
 
000:0
読み込み中…
キャンセル
保存