You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2010/03/17 18:02:03 UTC
svn commit: r924368 - /subversion/trunk/subversion/libsvn_subr/io.c
Author: rhuijben
Date: Wed Mar 17 17:02:02 2010
New Revision: 924368
URL: http://svn.apache.org/viewvc?rev=924368&view=rev
Log:
* subversion/libsvn_subr/io.c
(svn_io_file_mktemp):
Following up on r924360, update comment about const cast to document
the new assumptions.
Suggested by: stsp
Modified:
subversion/trunk/subversion/libsvn_subr/io.c
Modified: subversion/trunk/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/io.c?rev=924368&r1=924367&r2=924368&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/io.c (original)
+++ subversion/trunk/subversion/libsvn_subr/io.c Wed Mar 17 17:02:02 2010
@@ -3533,9 +3533,12 @@ svn_io_file_mktemp(apr_file_t **new_file
SVN_ERR(svn_path_cstring_from_utf8(&templ_apr, templ, pool));
- /* ### I don't want to copy the template string again just to
- * make it writable... so cast away const.
- * Should the UTF-8 conversion functions really be returning const??? */
+ /* ### svn_path_cstring_from_utf8() guarantees to make a copy of the
+ data available in POOL and we need a non-const pointer here,
+ as apr changes the template to return the new filename.
+
+ But we can't provide the filename to our caller as that might need
+ more bytes then there are XXXXs after converting it back to utf-8. */
status = apr_file_mktemp(new_file, (char *)templ_apr, flags, pool);
if (status)