1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

W32 fix for trustdb creation.

This commit is contained in:
Werner Koch 2008-01-30 13:26:32 +00:00
parent 843d6c69ef
commit b680d034fa
6 changed files with 34 additions and 13 deletions

View file

@ -1,3 +1,7 @@
2008-01-30 Werner Koch <wk@g10code.com>
* tdbio.c (tdbio_set_dbname): Also test for forward slash.
2008-01-29 Werner Koch <wk@g10code.com>
* keydb.c (maybe_create_keyring): Take care of a missing slash.

View file

@ -505,14 +505,25 @@ tdbio_set_dbname( const char *new_dbname, int create )
int rc;
char *p = strrchr( fname, DIRSEP_C );
mode_t oldmask;
int save_slash;
assert(p);
#if HAVE_W32_SYSTEM
{
/* Windows may either have a slash or a backslash. Take
care of it. */
char *pp = strrchr (fname, '/');
if (!p || pp > p)
p = pp;
}
#endif /*HAVE_W32_SYSTEM*/
assert (p);
save_slash = *p;
*p = 0;
if( access( fname, F_OK ) ) {
try_make_homedir( fname );
log_fatal( _("%s: directory does not exist!\n"), fname );
}
*p = DIRSEP_C;
*p = save_slash;
xfree(db_name);
db_name = fname;