summaryrefslogtreecommitdiff
path: root/src/core/wee-string.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2012-02-25 08:42:00 +0100
committerSebastien Helleu <flashcode@flashtux.org>2012-02-25 08:42:00 +0100
commit496c7d3e18e076959ab50201ce95e5b82e8903f6 (patch)
treeb2acc3abae82bfa221b3d6dfec9cbd25f1bd14b1 /src/core/wee-string.c
parentf38f62e7d8c3067c5d3bfe17377fbfef13f4cf0b (diff)
downloadweechat-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.c5
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");