driver: Fix usage of '$0' in ghcii.sh (#8873)
authorAustin Seipp <austin@well-typed.com>
Mon, 28 Jul 2014 12:53:32 +0000 (07:53 -0500)
committerAustin Seipp <austin@well-typed.com>
Mon, 28 Jul 2014 14:29:18 +0000 (09:29 -0500)
Signed-off-by: Austin Seipp <austin@well-typed.com>
driver/ghci/ghc.mk

index 4c5c09e..ba6984c 100644 (file)
@@ -22,7 +22,7 @@ install_driver_ghci:
        $(call removeFiles,                                "$(WRAPPER)")
        $(CREATE_SCRIPT)                                   "$(WRAPPER)"
        echo '#!$(SHELL)'                               >> "$(WRAPPER)"
-       echo 'exec "$(bindir)/ghc-$(ProjectVersion)" --interactive $${1+"$$@"}' >> "$(WRAPPER)"
+       echo 'exec "$(bindir)/ghc-$(ProjectVersion)" --interactive "$$@"' >> "$(WRAPPER)"
        $(EXECUTABLE_FILE)                                 "$(WRAPPER)"
        $(call removeFiles,"$(DESTDIR)$(bindir)/ghci")
        $(LN_S) ghci-$(ProjectVersion) "$(DESTDIR)$(bindir)/ghci"
@@ -57,7 +57,7 @@ install_driver_ghcii:
        $(call INSTALL_DIR,$(DESTDIR)$(bindir))
        $(call removeFiles,"$(GHCII_SCRIPT)")
        echo "#!$(SHELL)"                                  >> $(GHCII_SCRIPT)
-       echo 'exec "$$0"/../ghc --interactive $${1+"$$@"}' >> $(GHCII_SCRIPT)
+       echo 'exec "$$(dirname "$$0")"/ghc --interactive "$$@"' >> $(GHCII_SCRIPT)
        $(EXECUTABLE_FILE) $(GHCII_SCRIPT)
        cp $(GHCII_SCRIPT) $(GHCII_SCRIPT_VERSIONED)
        $(EXECUTABLE_FILE) $(GHCII_SCRIPT_VERSIONED)