about summary refs log tree commit diff
path: root/pkgs/build-support/emacs
diff options
context:
space:
mode:
authorLin Jian <me@linj.tech>2023-08-25 10:30:25 +0800
committerAnderson Torres <torres.anderson.85@protonmail.com>2023-08-25 17:42:21 +0000
commitd380784357e531122814f74fc0bbb64258231f60 (patch)
treea51f3cbd03bb7f13bca841319199a9f758b3143e /pkgs/build-support/emacs
parenta12258c461480a1c4a9e064b9cc2b1a519defee5 (diff)
emacsWithPackages: fix logic of adding EMACSNATIVELOADPATH
Without this change, EMACSNATIVELOADPATH will not be added if
EMACSLOADPATH is added.
Diffstat (limited to 'pkgs/build-support/emacs')
-rw-r--r--pkgs/build-support/emacs/wrapper.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/pkgs/build-support/emacs/wrapper.sh b/pkgs/build-support/emacs/wrapper.sh
index e8eecb8c86966..c18960c06fc3c 100644
--- a/pkgs/build-support/emacs/wrapper.sh
+++ b/pkgs/build-support/emacs/wrapper.sh
@@ -4,16 +4,17 @@ IFS=:
 
 newLoadPath=()
 newNativeLoadPath=()
-added=
+addedNewLoadPath=
+addedNewNativeLoadPath=
 
 if [[ -n $EMACSLOADPATH ]]
 then
     while read -rd: entry
     do
-        if [[ -z $entry && -z $added ]]
+        if [[ -z $entry && -z $addedNewLoadPath ]]
         then
             newLoadPath+=(@wrapperSiteLisp@)
-            added=1
+            addedNewLoadPath=1
         fi
         newLoadPath+=("$entry")
     done <<< "$EMACSLOADPATH:"
@@ -26,10 +27,10 @@ if [[ -n $EMACSNATIVELOADPATH ]]
 then
     while read -rd: entry
     do
-        if [[ -z $entry && -z $added ]]
+        if [[ -z $entry && -z $addedNewNativeLoadPath ]]
         then
             newNativeLoadPath+=(@wrapperSiteLispNative@)
-            added=1
+            addedNewNativeLoadPath=1
         fi
         newNativeLoadPath+=("$entry")
     done <<< "$EMACSNATIVELOADPATH:"