diff options
| author | Werner Koch <[email protected]> | 2008-01-30 13:26:32 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2008-01-30 13:26:32 +0000 |
| commit | b680d034fa265a33c8063a25d79280e87ef71e42 (patch) | |
| tree | 30ab742d5615b05199f0cfaa343d0f14210471db /g10/tdbio.c | |
| parent | Fixed a W32 crash in gpg2 when creating a new keyring. (diff) | |
| download | gnupg-b680d034fa265a33c8063a25d79280e87ef71e42.tar.gz gnupg-b680d034fa265a33c8063a25d79280e87ef71e42.zip | |
W32 fix for trustdb creation.
Diffstat (limited to 'g10/tdbio.c')
| -rw-r--r-- | g10/tdbio.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/g10/tdbio.c b/g10/tdbio.c index d763d2a92..2429f1a5d 100644 --- a/g10/tdbio.c +++ b/g10/tdbio.c @@ -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; |
