[git] GnuPG - branch, master, updated. gnupg-2.1.21-104-g2e1342b
by Justus Winter
cvs at cvs.gnupg.org
Tue Jul 18 16:16:55 CEST 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".
The branch, master has been updated
via 2e1342b78b020f5b28359b08a4f63cf11479602f (commit)
from b231959728a0056094134e0fca8cc916c24ef37e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2e1342b78b020f5b28359b08a4f63cf11479602f
Author: Justus Winter <justus at g10code.com>
Date: Tue Jul 18 16:15:45 2017 +0200
gpgscm,w32: Fix testing for absolute paths.
* tests/gpgscm/main.c (path_absolute_p): New function.
(load): Use new function.
Signed-off-by: Justus Winter <justus at g10code.com>
diff --git a/tests/gpgscm/main.c b/tests/gpgscm/main.c
index 4dae365..5540ac3 100644
--- a/tests/gpgscm/main.c
+++ b/tests/gpgscm/main.c
@@ -124,6 +124,19 @@ my_strusage( int level )
}
+
+static int
+path_absolute_p (const char *p)
+{
+#if _WIN32
+ return ((strlen (p) > 2 && p[1] == ':' && (p[2] == '\\' || p[2] == '/'))
+ || p[0] == '\\' || p[0] == '/');
+#else
+ return p[0] == '/';
+#endif
+}
+
+
/* Load the Scheme program from FILE_NAME. If FILE_NAME is not an
absolute path, and LOOKUP_IN_PATH is given, then it is qualified
with the values in scmpath until the file is found. */
@@ -139,9 +152,9 @@ load (scheme *sc, char *file_name,
FILE *h = NULL;
use_path =
- lookup_in_path && ! (file_name[0] == '/' || scmpath_len == 0);
+ lookup_in_path && ! (path_absolute_p (file_name) || scmpath_len == 0);
- if (file_name[0] == '/' || lookup_in_cwd || scmpath_len == 0)
+ if (path_absolute_p (file_name) || lookup_in_cwd || scmpath_len == 0)
{
h = fopen (file_name, "r");
if (! h)
-----------------------------------------------------------------------
Summary of changes:
tests/gpgscm/main.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
hooks/post-receive
--
The GNU Privacy Guard
http://git.gnupg.org
More information about the Gnupg-commits
mailing list