[pypy-svn] r46710 - pypy/dist/pypy/translator/c

arigo at codespeak.net arigo at codespeak.net
Tue Sep 18 10:34:49 CEST 2007


Author: arigo
Date: Tue Sep 18 10:34:48 2007
New Revision: 46710

Modified:
   pypy/dist/pypy/translator/c/node.py
Log:
With this, c_char_array_constant() will again generally produce
human-greppable string literals.


Modified: pypy/dist/pypy/translator/c/node.py
==============================================================================
--- pypy/dist/pypy/translator/c/node.py	(original)
+++ pypy/dist/pypy/translator/c/node.py	Tue Sep 18 10:34:48 2007
@@ -531,8 +531,10 @@
             yield '\t%s' % length.rstrip(', ')
             yield '}'
         elif self.T.OF == Char:
-            yield '\t%s%s' % (length,
-                              c_char_array_constant(''.join(self.obj.items)))
+            s = ''.join(self.obj.items)
+            if self.T._hints.get('isrpystring', False):
+                s += '\x00'
+            yield '\t%s%s' % (length, c_char_array_constant(s))
             yield '}'
         else:
             yield '\t%s{' % length



More information about the Pypy-commit mailing list