From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?0JjQstCw0L0g0KLRgNGD0YHQutC+0LI=?= Subject: [PATCH] ob-C.el: Fix command to perform on remote host Date: Mon, 24 Apr 2017 09:53:38 +0300 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c0673a6272371054de411c6 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47446) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2XsV-0005Ll-Ar for emacs-orgmode@gnu.org; Mon, 24 Apr 2017 02:53:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2XsU-0005TS-BK for emacs-orgmode@gnu.org; Mon, 24 Apr 2017 02:53:43 -0400 Received: from mail-wr0-x231.google.com ([2a00:1450:400c:c0c::231]:35709) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d2XsU-0005TJ-4N for emacs-orgmode@gnu.org; Mon, 24 Apr 2017 02:53:42 -0400 Received: by mail-wr0-x231.google.com with SMTP id z52so44061518wrc.2 for ; Sun, 23 Apr 2017 23:53:40 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode --94eb2c0673a6272371054de411c6 Content-Type: text/plain; charset=UTF-8 * lisp/ob-C.el (org-babel-C-execute): Made sure name of compiled program is converted to local representation before sending it to the shell on remote host. The problem was when one would try to evaluate C source code block in the file on remote host. Compilation would go normally, then evaluation will fail with error like "/bin/sh: unable to find file prevents that. TINYCHANGE --- lisp/ob-C.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ob-C.el b/lisp/ob-C.el index 795bcb2..e54e174 100644 --- a/lisp/ob-C.el +++ b/lisp/ob-C.el @@ -161,7 +161,7 @@ or `org-babel-execute:C++' or `org-babel-execute:D'." (org-babel-eval (pcase org-babel-c-variant ((or `c `cpp) - (concat tmp-bin-file cmdline)) + (concat (org-babel-process-file-name tmp-bin-file) cmdline)) (`d (format "%s %s %s %s" org-babel-D-compiler --94eb2c0673a6272371054de411c6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
* lisp/ob-C.el (org-babel-C-execute): Made sure name of co= mpiled
program is converted to local representation before sending it to the
shell on remote host.

The problem was when one would try to evaluate C source code block in
the file on remote host. Compilation would go normally, then
evaluation will fail with error like "/bin/sh: unable to find file
prevents that.

TINYCHANGE
---
=C2=A0lisp/ob-C.el | 2 +-
=C2=A01 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ob-C.el b/lisp/ob-C.el
index 795bcb2..e54e174 100644
--- a/lisp/ob-C.el
+++ b/lisp/ob-C.el
@@ -161,7 +161,7 @@ or `org-babel-execute:C++' or `org-babel-execute:D&= #39;."
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-babel-eval
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (pcase org-babel-c-variant
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((or `c `cpp)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (concat tmp-bin-file cmdl= ine))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (concat (org-babel-proces= s-file-name tmp-bin-file) cmdline))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (`d
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(format "%s %s = %s %s"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0org-babel-D-compiler
--94eb2c0673a6272371054de411c6--