- Fix from Stef Hoeben to get the eid-cache stuff working on win32

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@723 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
okir 2002-11-27 14:27:53 +00:00
parent 34ba5b223c
commit 51d8983b99
1 changed files with 7 additions and 1 deletions

View File

@ -396,9 +396,15 @@ int sc_set_card_driver(struct sc_context *ctx, const char *short_name)
int sc_get_cache_dir(struct sc_context *ctx, char *buf, size_t bufsize)
{
char *homedir;
const char *cache_dir = ".eid/cache";
const char *cache_dir;
#ifndef _WIN32
cache_dir = ".eid/cache";
homedir = getenv("HOME");
#else
cache_dir = "eid-cache";
homedir = getenv("USERPROFILE");
#endif
if (homedir == NULL)
return SC_ERROR_INTERNAL;
if (snprintf(buf, bufsize, "%s/%s", homedir, cache_dir) < 0)