chiark
/
gitweb
/
~cjwatson
/
bin.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add --prefix option; stop appending /debian/po to old-tree; check that target file...
[bin.git]
/
pwhich
diff --git
a/pwhich
b/pwhich
index bf877c20768eae669dd968e53684157ff15f6c31..262dc838553b1a370621ce1443330718f0736182 100755
(executable)
--- a/
pwhich
+++ b/
pwhich
@@
-7,15
+7,18
@@
for PROGRAM in "$@"; do
IFS=:
case $PROGRAM in
*/*)
IFS=:
case $PROGRAM in
*/*)
- if [ -x "$PROGRAM" ]; then
-
echo
"$PROGRAM"
+ if [ -
f "$PROGRAM" ] && [ -
x "$PROGRAM" ]; then
+
printf '%s\n'
"$PROGRAM"
RET=0
fi
;;
*)
for ELEMENT in $PATH; do
RET=0
fi
;;
*)
for ELEMENT in $PATH; do
- if [ -x "$ELEMENT/$PROGRAM" ]; then
- echo "$ELEMENT/$PROGRAM"
+ if [ -z "$ELEMENT" ]; then
+ ELEMENT=.
+ fi
+ if [ -f "$ELEMENT/$PROGRAM" ] && [ -x "$ELEMENT/$PROGRAM" ]; then
+ printf '%s\n' "$ELEMENT/$PROGRAM"
RET=0
break
fi
RET=0
break
fi