aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2009-11-06 05:25:08 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2009-11-06 05:25:08 +0000
commitba62c55b06a2732560a6811a10ce45c6d627597d (patch)
tree57eaf05118ffbdae54d106f371f18cc71bb72177
parenta225bead1dd7a5ec6d290fa98fda0d6c17b72dfd (diff)
oops, fix absolute paths after relative paths were working
svn path=/trunk/externals/hcs/; revision=12725
-rw-r--r--folder_list.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/folder_list.c b/folder_list.c
index 89e5671..3d5a85a 100644
--- a/folder_list.c
+++ b/folder_list.c
@@ -61,9 +61,13 @@ typedef struct _folder_list {
static void normalize_path(t_folder_list* x, char *normalized, const char *original)
{
t_symbol *cwd = canvas_getdir(x->x_canvas);
- if(sys_isabsolutepath(original)) return;
+ if(sys_isabsolutepath(original)) {
+ strncpy(normalized, original, FILENAME_MAX);
+ return;
+ }
strncpy(normalized, cwd->s_name, FILENAME_MAX);
- if(normalized[(strlen(normalized)-1)] != '/') strncat(normalized, "/", 1);
+ if(normalized[(strlen(normalized)-1)] != '/')
+ strncat(normalized, "/", 1);
if(original[0] == '.') {
if(original[1] == '/') {
strncat(normalized, original + 2,
@@ -75,7 +79,8 @@ static void normalize_path(t_folder_list* x, char *normalized, const char *origi
} else if(original[0] != '/') {
strncat(normalized, original,
FILENAME_MAX - strlen(normalized));
- }
+ } else
+ strncpy(normalized, original, FILENAME_MAX);
}
static void folder_list_output(t_folder_list* x)