view src/which.sh @ 27024:5d851ce07caf v8.2.4041

patch 8.2.4041: using unitialized pointer Commit: https://github.com/vim/vim/commit/aa9b3cacd52a6c34591bbd89fb6b06d4c097fe03 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 8 15:44:22 2022 +0000 patch 8.2.4041: using unitialized pointer Problem: Using unitialized pointer. Solution: Store "ht" when variable is in another script.
author Bram Moolenaar <Bram@vim.org>
date Sat, 08 Jan 2022 16:45:03 +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