SF.net SVN: geany:[3995] trunk/src/utils.c
ntrel at users.sourceforge.net
ntrel at xxxxx
Mon Jul 20 11:21:06 UTC 2009
Revision: 3995
http://geany.svn.sourceforge.net/geany/?rev=3995&view=rev
Author: ntrel
Date: 2009-07-20 11:21:05 +0000 (Mon, 20 Jul 2009)
Log Message:
-----------
Add warning about reusing string buffer in utils_build_path().
Modified Paths:
--------------
trunk/src/utils.c
Modified: trunk/src/utils.c
===================================================================
--- trunk/src/utils.c 2009-07-20 03:50:53 UTC (rev 3994)
+++ trunk/src/utils.c 2009-07-20 11:21:05 UTC (rev 3995)
@@ -1602,7 +1602,9 @@
/* Similar to g_build_path() but (re)using a fixed buffer, so never free it.
* This assumes a small enough resulting string length to be kept without freeing,
- * but this should be the case for filenames. */
+ * but this should be the case for filenames.
+ * @warning As the buffer is reused, you can't call this recursively, e.g. for a
+ * function argument and within the function called. */
const gchar *utils_build_path(const gchar *first, ...)
{
static GString *buffer = NULL;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list