Mercurial > mplayer.hg
changeset 35316:18fdd24d97ff
Do not pointlessly call getenv("HOME") twice, reuse the result instead.
author | reimar |
---|---|
date | Sat, 10 Nov 2012 14:45:56 +0000 |
parents | 56081c772b4a |
children | aa2026fd0c76 |
files | stream/cookies.c |
diffstat | 1 files changed, 2 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/stream/cookies.c Sat Nov 10 14:41:32 2012 +0000 +++ b/stream/cookies.c Sat Nov 10 14:45:56 2012 +0000 @@ -211,13 +211,12 @@ if (dir) { while ((ent = readdir(dir)) != NULL) { if ((ent->d_name)[0] != '.') { - const char *home = getenv("HOME"); - unsigned len = strlen(home) + + unsigned len = strlen(homedir) + sizeof("/.mozilla/default/") + strlen(ent->d_name) + sizeof("cookies.txt") + 1; buf = malloc(len); snprintf(buf, len, "%s/.mozilla/default/%s/cookies.txt", - home, ent->d_name); + homedir, ent->d_name); list = load_cookies_from(buf, list); free(buf); }