emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/pdf-tools 2a07329 4/6: fix: use POSIX standard builtin to


From: ELPA Syncer
Subject: [nongnu] elpa/pdf-tools 2a07329 4/6: fix: use POSIX standard builtin to search PATH
Date: Fri, 3 Dec 2021 10:58:21 -0500 (EST)

branch: elpa/pdf-tools
commit 2a07329f7bb753cd31e2f01193eb1c46b4b582f0
Author: Jacob Vallejo <jake@jahkeup.com>
Commit: Vedang Manerikar <ved.manerikar@gmail.com>

    fix: use POSIX standard builtin to search PATH
    
    Rather than iterating over paths to find a given executable, use the
    POSIX standard builtin `command` [1].
    
    [1]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html
    
    Signed-off-by: Jacob Vallejo <jake@jahkeup.com>
---
 server/autobuild | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/server/autobuild b/server/autobuild
index 9af5990..7db0f0f 100755
--- a/server/autobuild
+++ b/server/autobuild
@@ -64,16 +64,7 @@ which()
     if [ -z "$1" ]; then
         return 1
     fi
-    IFS=:
-    for dir in $PATH; do
-        if [ -x "$dir/$1" ]; then
-            printf "%s" "$dir/$1"
-            unset IFS
-            return 0
-        fi
-    done
-    unset IFS
-    return 1
+    command -v "$1"
 }
 
 # Quote $@ for the shell.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]