Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
appliance: Use configurable separator character for LIBGUESTFS_PATH.
On Windows, the path separator character will be ';' instead.
  • Loading branch information
Oberonc authored and rwmjones committed Feb 17, 2014
1 parent 22f6c79 commit 6b71b81
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions configure.ac
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/appliance.c
Expand Up @@ -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)
Expand All @@ -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;
Expand Down

0 comments on commit 6b71b81

Please sign in to comment.