浏览代码

Simplify getting editor env var

master
Arun Prakash Jana 6 年前
父节点
当前提交
32ca8ca133
找不到此签名对应的密钥 GPG 密钥 ID: A75979F35C080412
共有 1 个文件被更改,包括 8 次插入14 次删除
  1. +8
    -14
      src/nnn.c

+ 8
- 14
src/nnn.c 查看文件

@@ -3577,20 +3577,14 @@ int main(int argc, char *argv[])


/* Edit text in EDITOR, if opted */ /* Edit text in EDITOR, if opted */
if (getenv("NNN_USE_EDITOR")) { if (getenv("NNN_USE_EDITOR")) {
editor = xgetenv("VISUAL", NULL); editor = xgetenv("VISUAL", xgetenv("EDITOR", "vi"));
if (!editor) /* copier used as a temp var */
editor = xgetenv("EDITOR", "vi"); copier = editor;
if (editor) { while (*copier && *copier != ' ')
/* copier used as a temp var */ ++copier;
copier = editor; if (*copier == ' ') {
while (*copier) { *copier = '\0';
if (*copier == ' ') { editor_arg = ++copier;
*copier = '\0';
editor_arg = ++copier;
break;
}
++copier;
}
} }
} }




||||||
x
 
000:0
正在加载...
取消
保存