aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenis Krjuchkov <denis@crazydev.net>2013-01-24 00:56:46 +0600
committerDenis Krjuchkov <denis@crazydev.net>2013-01-28 00:13:45 +0600
commit3bd35d188320f20a98a1004c001b132fc0975437 (patch)
treedc2187e6dfd06441faeb66281804cda33f19a2f1 /src
parent6f3d70b5e24cebbd6fd8c3a665a801628ef912ff (diff)
downloadmpd-3bd35d188320f20a98a1004c001b132fc0975437.tar.gz
mpd-3bd35d188320f20a98a1004c001b132fc0975437.tar.xz
mpd-3bd35d188320f20a98a1004c001b132fc0975437.zip
Path: introduce MPD_PATH_MAX_UTF8
Diffstat (limited to 'src')
-rw-r--r--src/fs/Path.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/fs/Path.cxx b/src/fs/Path.cxx
index 393cb3038..294f60781 100644
--- a/src/fs/Path.cxx
+++ b/src/fs/Path.cxx
@@ -36,6 +36,16 @@
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "path"
+/**
+ * Maximal number of bytes required to represent path name in UTF-8
+ * (including nul-terminator).
+ * This value is a rought estimate of upper bound.
+ * It's based on path name limit in bytes (MPD_PATH_MAX)
+ * and assumption that some weird encoding could represent some UTF-8 4 byte
+ * sequences with single byte.
+ */
+#define MPD_PATH_MAX_UTF8 ((MPD_PATH_MAX - 1) * 4 + 1)
+
static char *fs_charset;
std::string Path::ToUTF8() const