浏览代码

Fix #537

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

+ 6
- 1
src/nnn.c 查看文件

@@ -1040,7 +1040,12 @@ static char *abspath(const char *path, const char *cwd)
size_t dst_size = 0, src_size = xstrlen(path), cwd_size = xstrlen(cwd);
const char *src;
char *dst;
char *resolved_path = malloc(src_size + (*path == '/' ? 0 : cwd_size) + 1);
/*
* We need to add 2 chars at the end as relative paths may start with:
* ./ (find .)
* no separator (fd .): this needs an additional char for '/'
*/
char *resolved_path = malloc(src_size + (*path == '/' ? 0 : cwd_size) + 2);
if (!resolved_path)
return NULL;



正在加载...
取消
保存