From 033b5d815a19a05441a99cdc744a6a8752d191cc Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 21 Mar 2010 13:32:59 +0000 Subject: Move code which extracts the filename from a given path into frontend. svn path=/trunk/netsurf/; revision=10139 --- amiga/misc.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'amiga/misc.c') diff --git a/amiga/misc.c b/amiga/misc.c index cee6aa688..f492fcf8a 100755 --- a/amiga/misc.c +++ b/amiga/misc.c @@ -1,5 +1,5 @@ /* - * Copyright 2008, 2009 Chris Young + * Copyright 2008-2010 Chris Young * * This file is part of NetSurf, http://www.netsurf-browser.org/ * @@ -24,6 +24,7 @@ #include "utils/messages.h" #include #include +#include "utils/utils.h" void warn_user(const char *warning, const char *detail) { @@ -83,6 +84,18 @@ char *path_to_url(const char *path) return r; } +/** + * Return the filename part of a full path + * + * \param path full path and filename + * \return filename (will be freed with free()) + */ + +char *filename_from_path(char *path) +{ + return strdup(FilePart(path)); +} + /** * returns a string without escape chars or |M chars. * (based on remove_underscores from utils.c) -- cgit v1.2.3