#
# Copyright (C) 1996-2007 Gero Kuhlmann
#
# $Id: nb_path_walk.m4,v 1.2 2007/01/06 18:31:20 gkminix Exp $
#
#
# Walk through PATH running BODY for each `ac_dir'.
#
# This function changed names throughout different versions of autoconf,
# so we re-implement it here again.
#
# NB_PATH_WALK([PATH = $PATH], BODY)
#
AC_DEFUN([NB_PATH_WALK],
[IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${PATH_SEPARATOR-:}"
m4_bmatch([$1], [[:;]],
[nb_dummy="$1"
for ac_dir in $nb_dummy],
[for ac_dir in m4_default([$1], [$PATH])])
do
  IFS="$ac_save_ifs"
  if test -n "$ac_dir" && test -d "$ac_dir"; then
    $2
  fi
done
])

