Browse Source

fix remote execution w/empty shebang header arg

Thanks to Nick Dokos for isolating this bug and suggesting this fix.

* lisp/ob-sh.el (org-babel-sh-evaluate): Don't could 0-length shebangs.
Eric Schulte 5 years ago
parent
commit
1c63cd2c98
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lisp/ob-sh.el

+ 2 - 1
lisp/ob-sh.el

@@ -190,7 +190,8 @@ return the value of the last statement in BODY."
 	    (list org-babel-sh-eoe-indicator))))
 	2)) "\n"))
     ('otherwise				; external shell script
-     (if (cdr (assoc :shebang params))
+     (if (and (cdr (assoc :shebang params))
+	      (> (length (cdr (assoc :shebang params))) 0))
 	 (let ((script-file (org-babel-temp-file "sh-script-"))
 	       (shebang (cdr (assoc :shebang params)))
 	       (padline (not (string= "no" (cdr (assoc :padline params))))))