diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2012-02-25 08:42:00 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2012-02-25 08:42:00 +0100 |
commit | 496c7d3e18e076959ab50201ce95e5b82e8903f6 (patch) | |
tree | b2acc3abae82bfa221b3d6dfec9cbd25f1bd14b1 /src/core/wee-string.c | |
parent | f38f62e7d8c3067c5d3bfe17377fbfef13f4cf0b (diff) | |
download | weechat-496c7d3e18e076959ab50201ce95e5b82e8903f6.zip |
core: fix expand of path "~" to home of user in function string_expand_home ("~/xxx" was ok, but not "~")
Diffstat (limited to 'src/core/wee-string.c')
-rw-r--r-- | src/core/wee-string.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/wee-string.c b/src/core/wee-string.c index 885d88ec8..1d16d6d0f 100644 --- a/src/core/wee-string.c +++ b/src/core/wee-string.c @@ -476,8 +476,11 @@ string_expand_home (const char *path) if (!path) return NULL; - if (!path[0] || (path[0] != '~') || (path[1] != DIR_SEPARATOR_CHAR)) + if (!path[0] || (path[0] != '~') + || ((path[1] && path[1] != DIR_SEPARATOR_CHAR))) + { return strdup (path); + } ptr_home = getenv ("HOME"); |