diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2004-03-24 00:03:38 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2004-03-24 00:03:38 +0000 |
commit | 2d42fc01f98cb053918f8a1cc23975e08b902614 (patch) | |
tree | 2f24a0be3ac63f1df4400afc28b85fc2b9246acd /content/fetch.c | |
parent | edbc58e53a8a7df6ebee1c908b6c3f42b29248fe (diff) | |
download | netsurf-2d42fc01f98cb053918f8a1cc23975e08b902614.tar.gz netsurf-2d42fc01f98cb053918f8a1cc23975e08b902614.tar.bz2 |
[project @ 2004-03-24 00:03:38 by jmb]
Improve handling of filename generation.
svn path=/import/netsurf/; revision=658
Diffstat (limited to 'content/fetch.c')
-rw-r--r-- | content/fetch.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/content/fetch.c b/content/fetch.c index eda81d823..7be161c46 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -686,13 +686,23 @@ struct HttpPost *fetch_post_convert(struct form_successful_control *control) if (control->file) { mimetype = fetch_mimetype(control->value); #ifdef riscos - temp = strrchr(control->value, '.') + 1; - assert(temp); + temp = strrchr(control->value, '.'); + if (!temp) { + temp = control->value; /* already leafname */ + } + else { + temp += 1; + } leafname = xcalloc(strlen(temp), sizeof(char)); __unixify_std(temp, leafname, strlen(temp), 0xfff); #else - leafname = strrchr(control->value, '/') + 1; - assert(leafname); + leafname = strrchr(control->value, '/') ; + if (!leafname) { + leafname = control->value; + } + else { + leafname += 1; + } #endif curl_formadd(&post, &last, CURLFORM_COPYNAME, control->name, |