- 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:
parent
34ba5b223c
commit
51d8983b99
|
@ -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)
|
int sc_get_cache_dir(struct sc_context *ctx, char *buf, size_t bufsize)
|
||||||
{
|
{
|
||||||
char *homedir;
|
char *homedir;
|
||||||
const char *cache_dir = ".eid/cache";
|
const char *cache_dir;
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
cache_dir = ".eid/cache";
|
||||||
homedir = getenv("HOME");
|
homedir = getenv("HOME");
|
||||||
|
#else
|
||||||
|
cache_dir = "eid-cache";
|
||||||
|
homedir = getenv("USERPROFILE");
|
||||||
|
#endif
|
||||||
if (homedir == NULL)
|
if (homedir == NULL)
|
||||||
return SC_ERROR_INTERNAL;
|
return SC_ERROR_INTERNAL;
|
||||||
if (snprintf(buf, bufsize, "%s/%s", homedir, cache_dir) < 0)
|
if (snprintf(buf, bufsize, "%s/%s", homedir, cache_dir) < 0)
|
||||||
|
|
Loading…
Reference in New Issue