view src/which.sh @ 20427:0ab8f8880a33 v8.2.0768

patch 8.2.0768: Vim9: memory leak in script test Commit: https://github.com/vim/vim/commit/e75ba268b35a9b3a1f8b47668e657259555fc5fa Author: Bram Moolenaar <Bram@vim.org> Date: Sat May 16 15:43:31 2020 +0200 patch 8.2.0768: Vim9: memory leak in script test Problem: Vim9: memory leak in script test. Solution: Clear typval before giving an error message.
author Bram Moolenaar <Bram@vim.org>
date Sat, 16 May 2020 15:45: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