소스 검색

Simplify getting editor env var

master
Arun Prakash Jana 6 년 전
부모
커밋
32ca8ca133
No known key found for this signature in database 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 */
if (getenv("NNN_USE_EDITOR")) {
editor = xgetenv("VISUAL", NULL);
if (!editor)
editor = xgetenv("EDITOR", "vi");
if (editor) {
/* copier used as a temp var */
copier = editor;
while (*copier) {
if (*copier == ' ') {
*copier = '\0';
editor_arg = ++copier;
break;
}
++copier;
}
editor = xgetenv("VISUAL", xgetenv("EDITOR", "vi"));
/* copier used as a temp var */
copier = editor;
while (*copier && *copier != ' ')
++copier;
if (*copier == ' ') {
*copier = '\0';
editor_arg = ++copier;
}
}



불러오는 중...
취소
저장