aboutsummaryrefslogtreecommitdiffstats
path: root/src/fs
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-17 22:47:09 +0200
committerMax Kellermann <max@duempel.org>2013-10-17 22:47:09 +0200
commit7fec2b02d419ab1de5589fb34d4fad90e9998aab (patch)
treea69e1f46c54aa0e3c3f2f1e1098bc2dc78df97a2 /src/fs
parent608a98c873b94826a98b8dbdf17aa02320de8776 (diff)
downloadmpd-7fec2b02d419ab1de5589fb34d4fad90e9998aab.tar.gz
mpd-7fec2b02d419ab1de5589fb34d4fad90e9998aab.tar.xz
mpd-7fec2b02d419ab1de5589fb34d4fad90e9998aab.zip
fs/Charset: GetFSCharset() returns "utf-8" by default
If fs_charset is empty, i.e. we're using the default "utf-8", GetFSCharset() should return exactly that instead of an empty std::string.
Diffstat (limited to '')
-rw-r--r--src/fs/Charset.cxx4
-rw-r--r--src/fs/Charset.hxx2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/fs/Charset.cxx b/src/fs/Charset.cxx
index 3e324f470..39bb36e77 100644
--- a/src/fs/Charset.cxx
+++ b/src/fs/Charset.cxx
@@ -70,10 +70,10 @@ SetFSCharset(const char *charset)
"SetFSCharset: fs charset is: %s", fs_charset.c_str());
}
-const std::string &
+const char *
GetFSCharset()
{
- return fs_charset;
+ return fs_charset.empty() ? "utf-8" : fs_charset.c_str();
}
std::string
diff --git a/src/fs/Charset.hxx b/src/fs/Charset.hxx
index 19dabeb2b..a89cb0459 100644
--- a/src/fs/Charset.hxx
+++ b/src/fs/Charset.hxx
@@ -29,7 +29,7 @@
* Gets file system character set name.
*/
gcc_const
-const std::string &
+const char *
GetFSCharset();
void