ソースを参照

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;
}


読み込み中…
キャンセル
保存