chiark
/
gitweb
/
~cjwatson
/
bin.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bsmtp-pull: drop -2; avoid connection sharing
[bin.git]
/
pwhich
diff --git
a/pwhich
b/pwhich
index 30d4c67cc8c724a9e483235b5b0e77c90390f087..262dc838553b1a370621ce1443330718f0736182 100755
(executable)
--- a/
pwhich
+++ b/
pwhich
@@
-7,14
+7,17
@@
for PROGRAM in "$@"; do
IFS=:
case $PROGRAM in
*/*)
IFS=:
case $PROGRAM in
*/*)
- if [ -x "$PROGRAM" ]; then
+ if [ -
f "$PROGRAM" ] && [ -
x "$PROGRAM" ]; then
printf '%s\n' "$PROGRAM"
RET=0
fi
;;
*)
for ELEMENT in $PATH; do
printf '%s\n' "$PROGRAM"
RET=0
fi
;;
*)
for ELEMENT in $PATH; do
- if [ -x "$ELEMENT/$PROGRAM" ]; then
+ if [ -z "$ELEMENT" ]; then
+ ELEMENT=.
+ fi
+ if [ -f "$ELEMENT/$PROGRAM" ] && [ -x "$ELEMENT/$PROGRAM" ]; then
printf '%s\n' "$ELEMENT/$PROGRAM"
RET=0
break
printf '%s\n' "$ELEMENT/$PROGRAM"
RET=0
break