summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xautogen.sh3
-rw-r--r--configure.ac3
-rw-r--r--cursor/load_cursor.c16
3 files changed, 16 insertions, 6 deletions
diff --git a/autogen.sh b/autogen.sh
index d15c0fb..7ba7a80 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -24,6 +24,9 @@ fi
autoreconf -v --install || exit 1
cd "$ORIGDIR" || exit $?
+git config --local --get format.subjectPrefix >/dev/null 2>&1 ||
+ git config --local format.subjectPrefix "PATCH libxcb-cursor"
+
if test -z "$NOCONFIGURE"; then
exec "$srcdir"/configure "$@"
fi
diff --git a/configure.ac b/configure.ac
index d548dd6..e97bc71 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,7 @@
dnl XCB_UTIL_M4_WITH_INCLUDE_PATH requires Autoconf >= 2.62
AC_PREREQ(2.62)
-AC_INIT([xcb-util-cursor],0.1.3,[xcb@lists.freedesktop.org])
+AC_INIT([xcb-util-cursor],[0.1.5],
+ [https://gitlab.freedesktop.org/xorg/lib/libxcb-cursor/-/issues])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_MACRO_DIR([m4])
diff --git a/cursor/load_cursor.c b/cursor/load_cursor.c
index e82fc63..c8d587b 100644
--- a/cursor/load_cursor.c
+++ b/cursor/load_cursor.c
@@ -44,6 +44,13 @@
#include "cursor.h"
#include "xcb_cursor.h"
+#ifdef O_CLOEXEC
+#define FOPEN_CLOEXEC "e"
+#else
+#define FOPEN_CLOEXEC ""
+#define O_CLOEXEC 0
+#endif
+
static const char *cursor_path(struct xcb_cursor_context_t *c) {
if (c->path == NULL) {
c->path = getenv("XCURSOR_PATH");
@@ -76,7 +83,7 @@ _XcursorThemeInherits (const char *full)
if (!full)
return NULL;
- f = fopen (full, "r");
+ f = fopen (full, "r" FOPEN_CLOEXEC);
if (f)
{
while (fgets (line, sizeof (line), f))
@@ -84,15 +91,14 @@ _XcursorThemeInherits (const char *full)
if (!strncmp (line, "Inherits", 8))
{
char *l = line + 8;
- char *r;
while (*l == ' ') l++;
if (*l != '=') continue;
l++;
while (*l == ' ') l++;
- result = malloc (strlen (l));
+ result = malloc (strlen (l) + 1);
if (result)
{
- r = result;
+ char *r = result;
while (*l)
{
while (XcursorSep(*l) || XcursorWhite (*l)) l++;
@@ -155,7 +161,7 @@ static int open_cursor_file(xcb_cursor_context_t *c, const char *theme, const ch
free(themedir);
return -1;
}
- fd = open(full, O_RDONLY);
+ fd = open(full, O_RDONLY | O_CLOEXEC);
free(full);
if (fd == -1 && inherits == NULL) {
if (asprintf(&full, "%s/index.theme", themedir) == -1) {