]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Handle NULL returns from Guile.
authorPaul Smith <psmith@gnu.org>
Wed, 18 Jan 2012 13:31:11 +0000 (13:31 +0000)
committerPaul Smith <psmith@gnu.org>
Wed, 18 Jan 2012 13:31:11 +0000 (13:31 +0000)
ChangeLog
guile.c

index 6fdc292d390a780875cebd974b7ef9eb07829f72..58ce5280d25484e00b0b56567608e84b89a56067 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-01-17  Paul Smith  <psmith@gnu.org>
+
+       * guile.c (func_guile): Handle NULL returns from Guile.
+
 2012-01-16  Paul Smith  <psmith@gnu.org>
 
        * make.h (PATH_SEPARATOR_CHAR): Allow resetting for crosscompiling
diff --git a/guile.c b/guile.c
index c32821a2cc97bea8358be0461e9d0e1db474ae58..2a35e8b2960aa625ef0102819d6b91214f4da394 100644 (file)
--- a/guile.c
+++ b/guile.c
@@ -92,8 +92,11 @@ func_guile (char *o, char **argv, const char *funcname UNUSED)
   if (argv[0] && argv[0][0] != '\0')
     {
       char *str = scm_with_guile (internal_guile_eval, argv[0]);
-      o = variable_buffer_output (o, str, strlen (str));
-      free (str);
+      if (str)
+        {
+          o = variable_buffer_output (o, str, strlen (str));
+          free (str);
+        }
     }
 
   return o;