[gimp] plug-ins: if --with-sendmail is set with a value, use it.



commit 912fcec37faf7d34c97e9a90425f21f98e14070e
Author: Jehan <jehan girinstud io>
Date:   Thu Jun 2 01:14:15 2016 +0200

    plug-ins: if --with-sendmail is set with a value, use it.
    
    Assume sendmail has to be installed in the path which was (optionally)
    given at build time. If no path is given at build, simply search in the
    $PATH.

 plug-ins/common/mail.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/plug-ins/common/mail.c b/plug-ins/common/mail.c
index 4127b80..65ebb51 100644
--- a/plug-ins/common/mail.c
+++ b/plug-ins/common/mail.c
@@ -126,10 +126,19 @@ query (void)
     { GIMP_PDB_INT32,    "encapsulation", "ignored" }
   };
 
-  /* check if xdg-email or sendmail is installed
-   * TODO: allow setting the location of the executable in preferences
+  /* Check if xdg-email or sendmail is installed.
+   * TODO: allow setting the location of the executable in preferences.
    */
-#ifdef SENDMAIL
+#ifdef SENDMAIL && SENDMAIL
+  /* If a directory has been set at build time, we assume that sendmail
+   * can only be in this directory. */
+  email_bin = g_build_path (SENDMAIL, "sendmail", NULL);
+  if (! g_file_test (email_bin, G_FILE_TEST_IS_EXECUTABLE))
+    {
+      g_free (email_bin);
+      email_bin = NULL;
+    }
+#elif defined SENDMAIL
   email_bin = g_find_program_in_path ("sendmail");
 #else
   email_bin = g_find_program_in_path ("xdg-email");


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