瀏覽代碼

Ensure script to run is not a directory

master
Arun Prakash Jana 5 年之前
父節點
當前提交
70d1b0d4d8
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: A75979F35C080412
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. +7
    -2
      src/nnn.c

+ 7
- 2
src/nnn.c 查看文件

@@ -3404,12 +3404,17 @@ nochange:
tmp = newpath;
}

/* Check if file exists */
if (access(tmp, F_OK) == -1) {
if (lstat(tmp, &sb) == -1) {
printwarn();
goto nochange;
}

/* Check if it's a directory */
if (S_ISDIR(sb.st_mode)) {
printmsg("directory");
goto nochange;
}

dir = NULL; /* dir used as temp var */
if (ndents)
dir = dents[cur].name;


Loading…
取消
儲存