aboutsummaryrefslogtreecommitdiffstats
path: root/g10/tdbio.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/tdbio.c')
-rw-r--r--g10/tdbio.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/g10/tdbio.c b/g10/tdbio.c
index c7f04f441..47dc51e2d 100644
--- a/g10/tdbio.c
+++ b/g10/tdbio.c
@@ -474,9 +474,18 @@ tdbio_set_dbname( const char *new_dbname, int create )
atexit( cleanup );
initialized = 1;
}
- fname = new_dbname? m_strdup( new_dbname )
- : make_filename(opt.homedir,
- "trustdb" EXTSEP_S "gpg", NULL );
+
+ if(new_dbname==NULL)
+ fname=make_filename(opt.homedir,"trustdb" EXTSEP_S "gpg", NULL);
+ else if (*new_dbname != DIRSEP_C )
+ {
+ if (strchr(new_dbname, DIRSEP_C) )
+ fname = make_filename (new_dbname, NULL);
+ else
+ fname = make_filename (opt.homedir, new_dbname, NULL);
+ }
+ else
+ fname = m_strdup (new_dbname);
if( access( fname, R_OK ) ) {
if( errno != ENOENT ) {