[MPlayer-cvslog] r35410 - trunk/stream/cookies.c
reimar
subversion at mplayerhq.hu
Sat Nov 10 15:45:56 CET 2012
Author: reimar
Date: Sat Nov 10 15:45:56 2012
New Revision: 35410
Log:
Do not pointlessly call getenv("HOME") twice, reuse the result instead.
Modified:
trunk/stream/cookies.c
Modified: trunk/stream/cookies.c
==============================================================================
--- trunk/stream/cookies.c Sat Nov 10 15:41:32 2012 (r35409)
+++ trunk/stream/cookies.c Sat Nov 10 15:45:56 2012 (r35410)
@@ -211,13 +211,12 @@ static struct cookie_list_type *load_coo
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);
}
More information about the MPlayer-cvslog
mailing list