summaryrefslogtreecommitdiff
path: root/amiga
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2010-03-21 13:32:59 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2010-03-21 13:32:59 +0000
commit033b5d815a19a05441a99cdc744a6a8752d191cc (patch)
treead0aadcb6bcfd10362fbe7f266906ecd9fa8fde3 /amiga
parent1f67fed782a2c20e5b8222ef5fb9867f036ff054 (diff)
downloadnetsurf-033b5d815a19a05441a99cdc744a6a8752d191cc.tar.gz
netsurf-033b5d815a19a05441a99cdc744a6a8752d191cc.tar.bz2
Move code which extracts the filename from a given path into frontend.
svn path=/trunk/netsurf/; revision=10139
Diffstat (limited to 'amiga')
-rwxr-xr-xamiga/misc.c15
1 files changed, 14 insertions, 1 deletions
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 <chris@unsatisfactorysoftware.co.uk>
+ * Copyright 2008-2010 Chris Young <chris@unsatisfactorysoftware.co.uk>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@@ -24,6 +24,7 @@
#include "utils/messages.h"
#include <stdlib.h>
#include <curl/curl.h>
+#include "utils/utils.h"
void warn_user(const char *warning, const char *detail)
{
@@ -84,6 +85,18 @@ char *path_to_url(const char *path)
}
/**
+ * 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)
* \param translate true to insert a linebreak where there was |M,