view src/which.sh @ 19168:c9258281045d v8.2.0143

patch 8.2.0143: Coverity warning for possible use of NULL pointer Commit: https://github.com/vim/vim/commit/81c3ea7496cbca2be12bf74a17575ff684343579 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 23 15:48:42 2020 +0100 patch 8.2.0143: Coverity warning for possible use of NULL pointer Problem: Coverity warning for possible use of NULL pointer. Solution: Check argv is not NULL.
author Bram Moolenaar <Bram@vim.org>
date Thu, 23 Jan 2020 16: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