diff options
author | Kalle Wallin <kaw@linux.se> | 2004-03-25 11:44:59 +0000 |
---|---|---|
committer | Kalle Wallin <kaw@linux.se> | 2004-03-25 11:44:59 +0000 |
commit | 268b0823860274d6079c5dd307770a0769d404ef (patch) | |
tree | 25dea360c739fca9ad931caa1f1aab320770338e /support.c | |
parent | 6777db4e48d23b9841ebd5e081c8dd3f4437a586 (diff) | |
download | mpd-268b0823860274d6079c5dd307770a0769d404ef.tar.gz mpd-268b0823860274d6079c5dd307770a0769d404ef.tar.xz mpd-268b0823860274d6079c5dd307770a0769d404ef.zip |
Added support for a configuration file ~/.ncmpcrc and color support.
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@473 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | support.c | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -68,6 +68,34 @@ lowerstr(char *str) return str; } + +char * +concat_path(char *p1, char *p2) +{ + size_t size; + char *path; + char append_slash = 0; + + size = strlen(p1); + if( size==0 || p1[size-1]!='/' ) + { + size++; + append_slash = 1; + } + size += strlen(p2); + size++; + + path = calloc(size, sizeof(char)); + strncpy(path, p1, size); + if( append_slash ) + strncat(path, "/", size); + strncat(path, p2, size); + + return path; +} + + + #ifndef HAVE_BASENAME char * basename(char *path) |