X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Frelocatable.h;h=5dfd71083e5541551f9f3c9d5c270daa78984bab;hb=217969cf220de4c0515eccd614de1640c3f46bcf;hp=5970be7a27456a26835552d257b9099966da28e6;hpb=1146b210ba48607a5a29ea516a5cda3d5afa6542;p=gnulib.git diff --git a/lib/relocatable.h b/lib/relocatable.h index 5970be7a2..5dfd71083 100644 --- a/lib/relocatable.h +++ b/lib/relocatable.h @@ -49,12 +49,15 @@ extern RELOCATABLE_DLL_EXPORTED void const char *curr_prefix); /* Returns the pathname, relocated according to the current installation - directory. */ + directory. + The returned string is either PATHNAME unmodified or a freshly allocated + string that you can free with free() after casting it to 'char *'. */ extern const char * relocate (const char *pathname); -/* Memory management: relocate() leaks memory, because it has to construct - a fresh pathname. If this is a problem because your program calls - relocate() frequently, think about caching the result. */ +/* Memory management: relocate() potentially allocates memory, because it has + to construct a fresh pathname. If this is a problem because your program + calls relocate() frequently, think about caching the result. Or free the + return value if it was different from the argument pathname. */ /* Convenience function: Computes the current installation prefix, based on the original