summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--guile/Makefile.am27
-rw-r--r--lib/mu-script.c20
3 files changed, 29 insertions, 20 deletions
diff --git a/configure.ac b/configure.ac
index d0c1672..77ba14c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -382,5 +382,5 @@ if test "x$ac_cv_header_wordexp_h" != "xyes"; then
fi
echo
-echo "Now, type 'gmake' to build mu (or 'gmake check' to run the unit tests, too)"
+echo "Now, type 'make' (or 'gmake') to build mu"
echo
diff --git a/guile/Makefile.am b/guile/Makefile.am
index 5a8b3ec..32c11de 100644
--- a/guile/Makefile.am
+++ b/guile/Makefile.am
@@ -20,7 +20,10 @@ include $(top_srcdir)/gtest.mk
# with separate builddir)
SUBDIRS= . mu scripts examples tests
-AM_CPPFLAGS=-I. -I${top_builddir} -I${top_srcdir}/lib ${GUILE_CFLAGS} ${GLIB_CFLAGS}
+AM_CPPFLAGS= \
+ -I. -I${top_builddir} -I${top_srcdir}/lib \
+ ${GUILE_CFLAGS} \
+ ${GLIB_CFLAGS}
# don't use -Werror, as it might break on other compilers
# use -Wno-unused-parameters, because some callbacks may not
@@ -28,28 +31,28 @@ AM_CPPFLAGS=-I. -I${top_builddir} -I${top_srcdir}/lib ${GUILE_CFLAGS} ${GLIB_CFL
AM_CFLAGS=-Wall -Wextra -Wno-unused-parameter -Wdeclaration-after-statement
AM_CXXFLAGS=-Wall -Wextra -Wno-unused-parameter
-lib_LTLIBRARIES= \
+lib_LTLIBRARIES= \
libguile-mu.la
-libguile_mu_la_SOURCES= \
- mu-guile.c \
- mu-guile.h \
- mu-guile-message.c \
+libguile_mu_la_SOURCES= \
+ mu-guile.c \
+ mu-guile.h \
+ mu-guile-message.c \
mu-guile-message.h
-libguile_mu_la_LIBADD= \
- ${top_builddir}/lib/libmu.la \
+libguile_mu_la_LIBADD= \
+ ${top_builddir}/lib/libmu.la \
${GUILE_LIBS}
libguile_mu_la_LDFLAGS= -export-dynamic
-XFILES= \
- mu-guile.x \
+XFILES= \
+ mu-guile.x \
mu-guile-message.x
-info_TEXINFOS= \
+info_TEXINFOS= \
mu-guile.texi
-mu_guile_TEXINFOS= \
+mu_guile_TEXINFOS= \
fdl.texi
BUILT_SOURCES=$(XFILES)
diff --git a/lib/mu-script.c b/lib/mu-script.c
index c4cbca3..584b4dd 100644
--- a/lib/mu-script.c
+++ b/lib/mu-script.c
@@ -308,21 +308,26 @@ gboolean
mu_script_guile_run (MuScriptInfo *msi, const char *muhome,
const char **args, GError **err)
{
- char *mainargs, *expr;
- const char * argv[] = {
- "guile", "-l", NULL, "-c", NULL, NULL
- };
+ const char *s;
+ char *mainargs, *expr;
+ char **argv;
g_return_val_if_fail (msi, FALSE);
g_return_val_if_fail (muhome, FALSE);
+ argv = g_new0 (char*, 6);
+ argv[0] = g_strdup("guile");
+ argv[1] = g_strdup("-l");
+
if (access (mu_script_info_path (msi), R_OK) != 0) {
mu_util_g_set_error (err, MU_ERROR_FILE_CANNOT_READ,
"failed to read script: %s",
strerror(errno));
return FALSE;
- }
- argv[2] = (char*)mu_script_info_path (msi);
+ }
+
+ s = mu_script_info_path (msi);
+ argv[2] = g_strdup (s ? s : "");
mainargs = mu_str_quoted_from_strv (args);
expr = g_strdup_printf (
@@ -332,12 +337,13 @@ mu_script_guile_run (MuScriptInfo *msi, const char *muhome,
mainargs ? mainargs : "");
g_free (mainargs);
+ argv[3] = g_strdup("-c");
argv[4] = expr;
scm_boot_guile (5, argv, guile_shell, NULL);
/* never reached but let's be correct(TM)*/
- g_free (expr);
+ g_strfreev (argv);
return TRUE;
}
#else /*!BUILD_GUILE*/