From bdd22e3a0846d38a0b6cdb822476ad2f15d03455 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 24 Mar 2015 13:30:57 +0100 Subject: [PATCH] gpg,w32: Handle forward slash in --keyring option. * g10/keydb.c (keydb_add_resource): Allow forward slash under Windows. -- GnuPG-bug-id: 1546 --- g10/keydb.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/g10/keydb.c b/g10/keydb.c index cf422a879..040ca65c2 100644 --- a/g10/keydb.c +++ b/g10/keydb.c @@ -369,10 +369,18 @@ keydb_add_resource (const char *url, unsigned int flags) } #endif /* !HAVE_DRIVE_LETTERS && !__riscos__ */ - if (*resname != DIRSEP_C ) + if (*resname != DIRSEP_C +#ifdef HAVE_W32_SYSTEM + && *resname != '/' /* Fixme: does not handle drive letters. */ +#endif + ) { /* Do tilde expansion etc. */ - if (strchr(resname, DIRSEP_C) ) + if (strchr (resname, DIRSEP_C) +#ifdef HAVE_W32_SYSTEM + || strchr (resname, '/') /* Windows also accepts this. */ +#endif + ) filename = make_filename (resname, NULL); else filename = make_filename (opt.homedir, resname, NULL);