mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
* import.c (import_one): When merging with a key we already have, don't
let a key conflict (same keyid but different key) stop the import: just skip the bad key and continue. * exec.c (make_tempdir): Under Win32, don't try environment variables for temp directories - GetTempDir tries environment variables internally, and it's better not to second-guess it in case MS adds some sort of temp dir handling to Windows at some point.
This commit is contained in:
parent
f6ccde9f14
commit
ffc98f20ea
3 changed files with 30 additions and 17 deletions
33
g10/exec.c
33
g10/exec.c
|
@ -67,8 +67,25 @@ static int make_tempdir(struct exec_info *info)
|
|||
ext=info->binary?"bin":"txt";
|
||||
|
||||
/* Make up the temp dir and files in case we need them */
|
||||
|
||||
if(tmp==NULL)
|
||||
{
|
||||
#if defined (__MINGW32__) || defined (__CYGWIN32__)
|
||||
tmp=m_alloc(256);
|
||||
if(GetTempPath(256,tmp)==0)
|
||||
strcpy(tmp,"c:\\windows\temp");
|
||||
else
|
||||
{
|
||||
int len=strlen(tmp);
|
||||
|
||||
/* GetTempPath may return with \ on the end */
|
||||
while(len>0 && tmp[len-1]=='\\')
|
||||
{
|
||||
tmp[len-1]='\0';
|
||||
len--;
|
||||
}
|
||||
}
|
||||
#else /* More unixish systems */
|
||||
tmp=getenv("TMPDIR");
|
||||
if(tmp==NULL)
|
||||
{
|
||||
|
@ -78,26 +95,12 @@ static int make_tempdir(struct exec_info *info)
|
|||
#ifdef __riscos__
|
||||
tmp="<Wimp$ScrapDir>.GnuPG";
|
||||
mkdir(tmp,0700); /* Error checks occur later on */
|
||||
#elif defined (__MINGW32__) || defined (__CYGWIN32__)
|
||||
tmp=m_alloc(256);
|
||||
if(GetTempPath(256,tmp)==0)
|
||||
strcpy(tmp,"c:\\temp");
|
||||
else
|
||||
{
|
||||
int len=strlen(tmp);
|
||||
|
||||
/* GetTempPath may return with \ on the end */
|
||||
while(len>0 && tmp[len-1]=='\\')
|
||||
{
|
||||
tmp[len-1]='\0';
|
||||
len--;
|
||||
}
|
||||
}
|
||||
#else
|
||||
tmp="/tmp";
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
info->tempdir=m_alloc(strlen(tmp)+strlen(DIRSEP_S)+10+1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue