diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2017-10-13 14:58:30 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2017-10-13 14:58:30 +0000 |
| commit | 66b1690aa8b5d05f540ded9999c08525cd1eaf7a (patch) | |
| tree | ccb5a3a743f1e008fd4b217c619ba99faee62612 /src/fl_utf8.cxx | |
| parent | db83933f585d156db2ae35d9c5649bb21b4555af (diff) | |
Replace remaining calls to getenv() with fl_getenv().
... except in driver code that uses Fl_System_Driver::getenv().
Todo: Check if all remaining calls of getenv() in driver code are correct
or might use ::getenv() to avoid one calling level for optimization.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12492 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_utf8.cxx')
| -rw-r--r-- | src/fl_utf8.cxx | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/fl_utf8.cxx b/src/fl_utf8.cxx index afd5c6005..0a79e5867 100644 --- a/src/fl_utf8.cxx +++ b/src/fl_utf8.cxx @@ -5,7 +5,7 @@ // // Author: Jean-Marc Lienher ( http://oksid.ch ) // Copyright 2000-2010 by O'ksi'D. -// Copyright 2016 by Bill Spitzak and others. +// Copyright 2016-2017 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -286,13 +286,25 @@ char * fl_utf2mbcs(const char *s) /** Cross-platform function to get environment variables with a UTF-8 encoded name or value. - This function is especially useful under the MSWindows platform where + This function is especially useful under the Windows platform where non-ASCII environment variables are encoded as wide characters. The returned value of the variable is encoded in UTF-8 as well. - On platforms other than MSWindows this function calls getenv directly. + On platforms other than Windows this function calls getenv directly. The return value is returned as-is. + The return value is a pointer to an implementation defined buffer: + - an internal buffer that is (re)allocated as needed (Windows) or + - the string in the environment itself (Unix, Linux, MaOS) or + - any other implementation (other platforms). + This string must be considered read-only and must not be freed by the caller. + + If the resultant string is to be used later it must be copied to a safe + place. The next call to fl_getenv() or any other environment changes may + overwrite the string. + + \note This function is not thread-safe. + \param[in] v the UTF-8 encoded environment variable \return the environment variable in UTF-8 encoding, or NULL in case of error. */ |
