view src/which.sh @ 11484:3933a3bf9385 v8.0.0625

patch 8.0.0625: shellescape() always escapes a newline commit https://github.com/vim/vim/commit/206155280def51160a9d81d983aed639015ffb44 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jun 5 18:46:26 2017 +0200 patch 8.0.0625: shellescape() always escapes a newline Problem: shellescape() always escapes a newline, which does not work with some shells. (Harm te Hennepe) Solution: Only escape a newline when the "special" argument is non-zero. (Christian Brabandt, closes #1590)
author Christian Brabandt <cb@256bit.org>
date Mon, 05 Jun 2017 19:00:03 +0200
parents 3fc0f57ecb91
children
line wrap: on
line source

#! /bin/sh
#
# which.sh -- find where an executable is located.  It's here because the
# "which" command is not supported everywhere.  Used by Makefile.

IFS=":"
for ac_dir in $PATH; do
	if test -f "$ac_dir/$1"; then
		echo "$ac_dir/$1"
		break
	fi
done