瀏覽代碼

If you call makepath() with an absolute name it returns a copy of it

master
lostd 10 年之前
父節點
當前提交
4b1b156a3b
共有 1 個檔案被更改,包括 10 行新增5 行删除
  1. +10
    -5
      noice.c

+ 10
- 5
noice.c 查看文件

@@ -490,11 +490,16 @@ makepath(char *dir, char *name)
{
char *path;

/* Handle root case */
if (strcmp(dir, "/") == 0)
asprintf(&path, "/%s", name);
else
asprintf(&path, "%s/%s", dir, name);
/* Handle absolute path */
if (name[0] == '/') {
path = xstrdup(name);
} else {
/* Handle root case */
if (strcmp(dir, "/") == 0)
asprintf(&path, "/%s", name);
else
asprintf(&path, "%s/%s", dir, name);
}

return path;
}


Loading…
取消
儲存