From 6a26cd6621b5f0b70177b0d17ed433b5669f1314 Mon Sep 17 00:00:00 2001 From: oy Date: Thu, 7 Oct 2010 23:51:07 +0200 Subject: fixed various problems with the file dialog in the editor --- src/base/system.c | 6 +++++- src/base/system.h | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src/base') diff --git a/src/base/system.c b/src/base/system.c index 25e89896..6a70452f 100644 --- a/src/base/system.c +++ b/src/base/system.c @@ -997,7 +997,7 @@ int fs_chdir(const char *path) return 1; } -void fs_parent_dir(char *path) +int fs_parent_dir(char *path) { char *parent = 0; for(; *path; ++path) @@ -1007,7 +1007,11 @@ void fs_parent_dir(char *path) } if(parent) + { *parent = 0; + return 0; + } + return 1; } void swap_endian(void *data, unsigned elem_size, unsigned num) diff --git a/src/base/system.h b/src/base/system.h index 62fe02e9..3d0d5cc7 100644 --- a/src/base/system.h +++ b/src/base/system.h @@ -970,10 +970,13 @@ int fs_chdir(const char *path); Parameters: path - The directory string + Returns: + Returns 0 on success, 1 on failure. + Remarks: - The string is treated as zero-termineted string. */ -void fs_parent_dir(char *path); +int fs_parent_dir(char *path); /* Group: Undocumented -- cgit 1.4.1