[Pkg-libvirt-commits] [libguestfs] 01/19: appliance: Use configurable separator character for LIBGUESTFS_PATH.

Hilko Bengen bengen at moszumanska.debian.org
Wed Feb 26 08:45:15 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch experimental
in repository libguestfs.

commit 6b71b81a5f4b1bfbf9fb4efa576fe7e7ae2368a8
Author: Or Goshen <oberonc at gmail.com>
Date:   Mon Feb 17 14:51:56 2014 +0000

    appliance: Use configurable separator character for LIBGUESTFS_PATH.
    
    On Windows, the path separator character will be ';' instead.
---
 configure.ac    | 4 ++++
 src/appliance.c | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index e07c89f..9a6d169 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1574,6 +1574,10 @@ PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0], [
 ])
 AM_CONDITIONAL([HAVE_BASH_COMPLETION],[test "x$bash_completion" = "xyes"])
 
+dnl For search paths.
+AC_DEFINE_UNQUOTED([PATH_SEPARATOR],["$PATH_SEPARATOR"],
+                   [Character that separates path elements in search paths])
+
 dnl Library versioning.
 MAX_PROC_NR=`cat $srcdir/src/MAX_PROC_NR`
 AC_SUBST(MAX_PROC_NR)
diff --git a/src/appliance.c b/src/appliance.c
index 3eaf635..5115ebe 100644
--- a/src/appliance.c
+++ b/src/appliance.c
@@ -907,7 +907,7 @@ find_path (guestfs_h *g,
    * libguestfs < 1.5.4).
    */
   do {
-    len = strcspn (pelem, ":");
+    len = strcspn (pelem, PATH_SEPARATOR);
 
     /* Empty element or "." means current directory. */
     if (len == 0)
@@ -926,7 +926,7 @@ find_path (guestfs_h *g,
 
     free (*pelem_ret);
 
-    if (pelem[len] == ':')
+    if (pelem[len] == PATH_SEPARATOR[0])
       pelem += len + 1;
     else
       pelem += len;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list