view src/which.sh @ 32138:2c09e40ce3da v9.0.1400

patch 9.0.1400: find_file_in_path() is not reentrant Commit: https://github.com/vim/vim/commit/5145c9a829cd43cb9e7962b181bf99226eb3a53f Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 11 13:55:53 2023 +0000 patch 9.0.1400: find_file_in_path() is not reentrant Problem: find_file_in_path() is not reentrant. Solution: Instead of global variables pass pointers to the functions. (closes #12093)
author Bram Moolenaar <Bram@vim.org>
date Sat, 11 Mar 2023 15:00:04 +0100
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