view src/which.sh @ 31435:8fe720031437 v9.0.1050

patch 9.0.1050: using freed memory when assigning to variable twice Commit: https://github.com/vim/vim/commit/6342e2c5a6570231aefabd8e34c2f2cb22f6927a Author: Bram Moolenaar <Bram@vim.org> Date: Mon Dec 12 18:56:32 2022 +0000 patch 9.0.1050: using freed memory when assigning to variable twice Problem: Using freed memory when assigning to variable twice. Solution: Make copy of the list type. (closes https://github.com/vim/vim/issues/11691)
author Bram Moolenaar <Bram@vim.org>
date Mon, 12 Dec 2022 20: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