diff options
author | Sven Weidauer <sven.weidauer@gmail.com> | 2011-02-27 13:21:42 +0000 |
---|---|---|
committer | Sven Weidauer <sven.weidauer@gmail.com> | 2011-02-27 13:21:42 +0000 |
commit | ff0aa37393afad23c5f114634a1df6f4b64fdb71 (patch) | |
tree | 8c0d45e177512c685abbc0f105a948e2a9c2ae3f | |
parent | 7e423186840f9a384c2f0afea2850ae8c5935d8a (diff) | |
download | netsurf-ff0aa37393afad23c5f114634a1df6f4b64fdb71.tar.gz netsurf-ff0aa37393afad23c5f114634a1df6f4b64fdb71.tar.bz2 |
Implementing path utility functions.
svn path=/trunk/netsurf/; revision=11841
-rw-r--r-- | cocoa/utils.m | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cocoa/utils.m b/cocoa/utils.m index cc8b29f81..c9cef7a23 100644 --- a/cocoa/utils.m +++ b/cocoa/utils.m @@ -44,14 +44,16 @@ void PDF_Password(char **owner_pass, char **user_pass, char *path) char *filename_from_path(char *path) { - UNIMPL(); - return NULL; + return strdup( [[[NSString stringWithUTF8String: path] lastPathComponent] UTF8String] ); } bool path_add_part(char *path, int length, const char *newpart) { - UNIMPL(); - return false; + NSString *newPath = [[NSString stringWithUTF8String: path] stringByAppendingPathComponent: [NSString stringWithUTF8String: newpart]]; + + strncpy( path, [newPath UTF8String], length ); + + return true; } void tree_icon_name_from_content_type(char *buffer, content_type type) |