summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--THANKS2
-rwxr-xr-xautogen.sh10
-rw-r--r--configure.ac5
-rw-r--r--libguile/i18n.c2
-rw-r--r--libguile/init.c8
-rw-r--r--libguile/load.c28
6 files changed, 32 insertions, 23 deletions
diff --git a/THANKS b/THANKS
index 1cc749aab..1aeb4a429 100644
--- a/THANKS
+++ b/THANKS
@@ -43,6 +43,7 @@ Authors of free software libraries that have been included into Guile
since the last release:
Jim Bender
+ Per Bothner
Rob Browning
Oleg Kiselyov
Alex Shinn
@@ -85,6 +86,7 @@ For fixes or providing information which led to a fix:
Andrew Gaylard
Nils Gey
Eric Gillespie, Jr
+ Nala Ginrut
Didier Godefroy
Panicz Maciej Godek
John Goerzen
diff --git a/autogen.sh b/autogen.sh
index af1ade60d..2e39fb5d8 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -15,7 +15,15 @@ autoconf --version
echo ""
automake --version
echo ""
-libtoolize --version
+
+# Typical MacOS X installations rename 'libtoolize' to 'glibtoolize', so
+# adjust to that.
+if test "`uname -s`" = "Darwin"; then
+ glibtoolize --version
+else
+ libtoolize --version
+fi
+
echo ""
${M4:-m4} --version
echo ""
diff --git a/configure.ac b/configure.ac
index 152460132..6e83af159 100644
--- a/configure.ac
+++ b/configure.ac
@@ -751,9 +751,8 @@ AC_CHECK_HEADERS([assert.h crt_externs.h])
# truncate - not in mingw
# isblank - available as a GNU extension or in C99
# _NSGetEnviron - Darwin specific
-# strcoll_l, newlocale - GNU extensions (glibc), also available on Darwin
+# strcoll_l, newlocale, uselocale, utimensat - POSIX.1-2008
# fork - unavailable on Windows
-# utimensat - posix.1-2008
# sched_getaffinity, sched_setaffinity - GNU extensions (glibc)
# sendfile - non-POSIX, found in glibc
#
@@ -766,7 +765,7 @@ AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid \
strdup system usleep atexit on_exit chown link fcntl ttyname getpwent \
getgrent kill getppid getpgrp fork setitimer getitimer strchr strcmp \
index bcopy memcpy rindex truncate unsetenv isblank _NSGetEnviron \
- strcoll strcoll_l newlocale utimensat sched_getaffinity \
+ strcoll strcoll_l newlocale uselocale utimensat sched_getaffinity \
sched_setaffinity sendfile])
# Reasons for testing:
diff --git a/libguile/i18n.c b/libguile/i18n.c
index c6b9b845e..f0e344329 100644
--- a/libguile/i18n.c
+++ b/libguile/i18n.c
@@ -40,7 +40,7 @@
#include <unicase.h>
#include <unistr.h>
-#if (defined HAVE_NEWLOCALE) && (defined HAVE_STRCOLL_L)
+#if defined HAVE_NEWLOCALE && defined HAVE_STRCOLL_L && defined HAVE_USELOCALE
/* The GNU thread-aware locale API is documented in ``Thread-Aware Locale
Model, a Proposal'', by Ulrich Drepper:
diff --git a/libguile/init.c b/libguile/init.c
index d2928bd60..dd63574fd 100644
--- a/libguile/init.c
+++ b/libguile/init.c
@@ -1,6 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- * 2004, 2006, 2009, 2010, 2011, 2012, 2013,
- * 2014 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2004, 2006, 2009-2014 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -312,7 +310,9 @@ scm_boot_guile (int argc, char ** argv, void (*main_func) (), void *closure)
/* On Windows, convert backslashes in argv[0] to forward
slashes. */
- scm_i_mirror_backslashes (argv[0]);
+ if (argc > 0)
+ scm_i_mirror_backslashes (argv[0]);
+
c.main_func = main_func;
c.closure = closure;
c.argc = argc;
diff --git a/libguile/load.c b/libguile/load.c
index a68d96d7d..b6e07a549 100644
--- a/libguile/load.c
+++ b/libguile/load.c
@@ -402,24 +402,24 @@ SCM scm_listofnullstr;
/* Utility functions for assembling C strings in a buffer.
*/
-struct stringbuf {
+struct stringbuf
+{
char *buf, *ptr;
size_t buf_len;
};
static void
-stringbuf_free (void *data)
-{
- struct stringbuf *buf = (struct stringbuf *)data;
- free (buf->buf);
-}
-
-static void
stringbuf_grow (struct stringbuf *buf)
{
- size_t ptroff = buf->ptr - buf->buf;
- buf->buf_len *= 2;
- buf->buf = scm_realloc (buf->buf, buf->buf_len);
+ size_t ptroff, prev_len;
+ void *prev_buf = buf->buf;
+
+ prev_len = buf->buf_len;
+ ptroff = buf->ptr - buf->buf;
+
+ buf->buf_len *= 2;
+ buf->buf = scm_gc_malloc_pointerless (buf->buf_len, "search-path");
+ memcpy (buf->buf, prev_buf, prev_len);
buf->ptr = buf->buf + ptroff;
}
@@ -557,6 +557,7 @@ search_path (SCM path, SCM filename, SCM extensions, SCM require_exts,
char *filename_chars;
size_t filename_len;
SCM result = SCM_BOOL_F;
+ char initial_buffer[256];
if (scm_ilength (path) < 0)
scm_misc_error ("%search-path", "path is not a proper list: ~a",
@@ -618,9 +619,8 @@ search_path (SCM path, SCM filename, SCM extensions, SCM require_exts,
if (scm_is_null (extensions))
extensions = scm_listofnullstr;
- buf.buf_len = 512;
- buf.buf = scm_malloc (buf.buf_len);
- scm_dynwind_unwind_handler (stringbuf_free, &buf, SCM_F_WIND_EXPLICITLY);
+ buf.buf_len = sizeof initial_buffer;
+ buf.buf = initial_buffer;
/* Try every path element.
*/