]> granicus.if.org Git - python/commitdiff
Create Py_UNICODE_strcat() function
authorVictor Stinner <victor.stinner@haypocalc.com>
Wed, 1 Sep 2010 23:43:50 +0000 (23:43 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Wed, 1 Sep 2010 23:43:50 +0000 (23:43 +0000)
Include/unicodeobject.h
Objects/unicodeobject.c

index 5fadb99a6929a422e0f0025e1309aa1386dd427d..afef5d0ff107a7de1218afd11559dccbc5621bc7 100644 (file)
@@ -1573,6 +1573,9 @@ PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strcpy(
     Py_UNICODE *s1,
     const Py_UNICODE *s2);
 
+PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strcat(
+    Py_UNICODE *s1, const Py_UNICODE *s2);
+
 PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strncpy(
     Py_UNICODE *s1,
     const Py_UNICODE *s2,
index 9cabd117ed4ec426268f5b14272acf961bb8229d..95823ad827a0b3b6a6a0204e87169f612b6fbc91 100644 (file)
@@ -9951,6 +9951,15 @@ Py_UNICODE_strncpy(Py_UNICODE *s1, const Py_UNICODE *s2, size_t n)
     return s1;
 }
 
+Py_UNICODE*
+Py_UNICODE_strcat(Py_UNICODE *s1, const Py_UNICODE *s2)
+{
+    Py_UNICODE *u1 = s1;
+    u1 += Py_UNICODE_strlen(u1);
+    Py_UNICODE_strcpy(u1, s2);
+    return s1;
+}
+
 int
 Py_UNICODE_strcmp(const Py_UNICODE *s1, const Py_UNICODE *s2)
 {