[Python-checkins] r84429 - in python/branches/py3k: Include/unicodeobject.h Objects/unicodeobject.c

victor.stinner python-checkins at python.org
Thu Sep 2 01:43:50 CEST 2010


Author: victor.stinner
Date: Thu Sep  2 01:43:50 2010
New Revision: 84429

Log:
Create Py_UNICODE_strcat() function

Modified:
   python/branches/py3k/Include/unicodeobject.h
   python/branches/py3k/Objects/unicodeobject.c

Modified: python/branches/py3k/Include/unicodeobject.h
==============================================================================
--- python/branches/py3k/Include/unicodeobject.h	(original)
+++ python/branches/py3k/Include/unicodeobject.h	Thu Sep  2 01:43:50 2010
@@ -1573,6 +1573,9 @@
     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,

Modified: python/branches/py3k/Objects/unicodeobject.c
==============================================================================
--- python/branches/py3k/Objects/unicodeobject.c	(original)
+++ python/branches/py3k/Objects/unicodeobject.c	Thu Sep  2 01:43:50 2010
@@ -9951,6 +9951,15 @@
     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)
 {


More information about the Python-checkins mailing list