summaryrefslogtreecommitdiff
path: root/src/if_python.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/if_python.c')
-rw-r--r--src/if_python.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/if_python.c b/src/if_python.c
index cf2ab9aa2..a1291d736 100644
--- a/src/if_python.c
+++ b/src/if_python.c
@@ -737,6 +737,21 @@ static PyObject *FunctionGetattr(PyObject *, char *);
}
#endif
+#if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
+ static void *
+py_memsave(void *p, size_t len)
+{
+ void *r;
+
+ if (!(r = PyMem_Malloc(len)))
+ return NULL;
+ mch_memmove(r, p, len);
+ return r;
+}
+
+# define PY_STRSAVE(s) ((char_u *) py_memsave(s, STRLEN(s) + 1))
+#endif
+
/*
* Include the code shared with if_python3.c
*/